Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to find a * (Ascterisc Simbol)

1 view
Skip to first unread message

Stalin Torres

unread,
Aug 18, 1999, 3:00:00 AM8/18/99
to
Hi, Every body
i have a little problem if you know how to help me please do it

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.

Rob Bovey

unread,
Aug 18, 1999, 3:00:00 AM8/18/99
to
Hi Stalin,

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...

Laurent Longre

unread,
Aug 21, 1999, 3:00:00 AM8/21/99
to Stalin Torres

Use this :

Cells.Replace "~*", "", xlPart

Laurent

Stalin Torres a écrit :

Rob Bovey

unread,
Aug 21, 1999, 3:00:00 AM8/21/99
to
Uhhg, that was easy <vbg>.

--
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 Longre

unread,
Aug 22, 1999, 3:00:00 AM8/22/99
to

Do you speak a bit French, Rob? In such cases, we say : "Pourquoi faire
simple quand on peut faire compliqué?" (difficult too translate)

Laurent :-)

Rob Bovey a écrit :

Rob Bovey

unread,
Aug 22, 1999, 3:00:00 AM8/22/99
to
> Do you speak a bit French, Rob? In such cases, we say : "Pourquoi faire
> simple quand on peut faire compliqué?" (difficult too translate)

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."

David J. Braden

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to
Ah, mon cher Rob, but it sounds *so* much more elegant in French. Except that it
translates into the opposite direction: "Why simplify things when you can make
them complicated?", which pretty much sums up classic French cooking,
philosophy, the language arts, and driving habits. <g>

Glad to have discovered this NG. Many thanks to you guys. Now, back to the DLL's.

Dave Braden
newbie

Laurent Longre

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to

But, David... you... you SPEAK FRENCH !!!

IT IS A MIRACLE !!!! :-))))))))

Laurent

"David J. Braden" a écrit :

Laurent Longre

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to
"David J. Braden" a écrit :
>
> Ah, mon cher Rob, but it sounds *so* much more elegant in French. Except that it
> translates into the opposite direction: "Why simplify things when you can make
> them complicated?", which pretty much sums up classic French cooking,
> philosophy, the language arts, and driving habits. <g>

... and love practices :-))))))))))

Laurent

0 new messages