tcarter963
New Member
- Joined
- Aug 3, 2006
- Messages
- 38
I have some text in cell C2 that looks like this: clonidine_Area
I want to copy the text before the underscore and paste it to another cell.
I've gotten this far but don't know how to proceed... How do I use the position number to selectively copy the string that I want? Any help would be greatly appreciated.
Sub Cp()
Dim SearchString, SearchChar, MyPos
SearchString = ActiveSheet.Range("C2")
SearchChar = "_"
MyPos = InStr(1, SearchString, SearchChar, 1)
End Sub
I want to copy the text before the underscore and paste it to another cell.
I've gotten this far but don't know how to proceed... How do I use the position number to selectively copy the string that I want? Any help would be greatly appreciated.
Sub Cp()
Dim SearchString, SearchChar, MyPos
SearchString = ActiveSheet.Range("C2")
SearchChar = "_"
MyPos = InStr(1, SearchString, SearchChar, 1)
End Sub