-
Solved: string with asterisk
hi,
i am getting a string from a text file that is no longer than 20 characters in length. the string may contain asterisks that i want to remove.
so for example, if the string is "***APP**LE**, i want the string to be "APPLE".
i want to avoid writing the string to a cell. is this possible?
thanks
rem
-
Hi there,
You don't mention how (code example) you are getting the string(s), but have you tried Replace() ?
[VBA]Sub exa()
Dim myString As String
myString = "**AP**PLE*"
MsgBox Replace(myString, Chr(42), vbNullString)
End Sub[/VBA]
-
mark,
just what i needed.
thanks a lot!
rem
-
You can also remove those asterisks in the worksheet:
[VBA]
Sub M_snb()
activesheet.cells.replace "~*",""
end Sub
[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules