Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a range of cells with a name in them. What is the best way to
check to see if each cell has the "_" character or the "-" character in the string? I would also like to remove it. Right now i have: If Not Range("A4").Find("-") Is Nothing Then fileName = VBA.Replace(Range("A4").Value, "-", "") ElseIf Not Range("A4").Find("_") Is Nothing Then fileName = VBA.Replace(Range("A4").Value, "_", "") End If I'm using the VBA.Replace method to replace the above characters with a blank. (If the .Find method is not nothing, replace the characters) It works fine, just didn't know if there was a faster, more efficient way? ....like an array or something... dck |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
find a character in a string | Excel Discussion (Misc queries) | |||
Excel-Match 1st text character in a string to a known character? | Excel Worksheet Functions | |||
Problem with VB string character limit. | Excel Worksheet Functions | |||
check if the text string start with a specific character | New Users to Excel | |||
Splitting Character String | Excel Worksheet Functions |