the situation:
1) I have in a worksheet some cells with alphanumeric values like 3456* or
2341* whatever
2) I need find the Asterisc simbol and replace with ""
3) the number that I wait for will be 3456 and 2341
the problem:
i´m using this code:
With Datos
.Replace what:="*", Replacement:="", LookAt:=xlWhole
End With
it replace ALL the range called Datos with a "" in other words, the code
deletes Datos
Question:
How can i correct this problem?
Alot of thanks.
PD: excuse my English, I speak spanish.
Since * is a special character, I think you'll need a custom routine to
do this. Here's a quick one I worked up:
Sub RemoveAsterisk(ByVal rngRemove As Range)
Dim lPos As Long
Dim rngCell As Range
Dim szValue As String
For Each rngCell In rngRemove
szValue = rngCell.Value
If Len(szValue) > 0 Then
lPos = InStr(szValue, "*")
If lPos > 0 Then
rngCell.Value = Left$(szValue, lPos - 1) _
& Right$(szValue, Len(szValue) - lPos)
End If
End If
Next rngCell
End Sub
--
Rob Bovey, MCSE
The Payne Consulting Group
http://www.payneconsulting.com
* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
Stalin Torres <stal...@hotmail.com> wrote in message
news:#MtQf6Y6#GA.60@cppssbbsa03...
Cells.Replace "~*", "", xlPart
Laurent
Stalin Torres a écrit :
--
Rob Bovey, MCSE
The Payne Consulting Group
http://www.payneconsulting.com
* Please post all responses to this newsgroup *
* I delete all unsolicited e-mail messages *
Laurent Longre <lon...@wanadoo.fr> wrote in message
news:37BEEBE2...@wanadoo.fr...
Laurent :-)
Rob Bovey a écrit :
Hi Laurent,
No, I don't speak French. But I bet the above resembles an American
expression that goes something like: "If it was a snake it would've bit me."
Glad to have discovered this NG. Many thanks to you guys. Now, back to the DLL's.
Dave Braden
newbie
IT IS A MIRACLE !!!! :-))))))))
Laurent
"David J. Braden" a écrit :
... and love practices :-))))))))))
Laurent