Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Partial String
Try:
Dim myStr As String Dim myNewStr As String myStr = "67890 / 1111" myNewStr = Right(myStr, 4) Debug.Print myNewStr Hope this helps Rowan mjack003 wrote: Howdy, How would I go about deleting entire strings, of variable length, saving only the last four digits of each? Ex: myStr = 67890 / 1111 and I want myNEWStr = 1111. I need to automate this in VBA. Appreciate the help, Mjack |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Partial String
Howdy, How would I go about deleting entire strings, of variable length, saving only the last four digits of each? Ex: myStr = 67890 / 1111 and I want myNEWStr = 1111. I need to automate this in VBA. Appreciate the help, Mjack -- mjack003 ------------------------------------------------------------------------ mjack003's Profile: http://www.excelforum.com/member.php...fo&userid=5141 View this thread: http://www.excelforum.com/showthread...hreadid=494043 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Partial String
That works great but I don't think I was very clear. I need everything after the "/" backslash. So is there a way to omit everything before that character and save only the remaining part? Thanks for the input, Mjack -- mjack003 ------------------------------------------------------------------------ mjack003's Profile: http://www.excelforum.com/member.php...fo&userid=5141 View this thread: http://www.excelforum.com/showthread...hreadid=494043 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Partial String
Try:
Dim myStr As String Dim myNewStr As String myStr = "67890 / 1111" myNewStr = Mid(myStr, InStr(1, myStr, "/") + 1, Len(myStr)) Debug.Print myNewStr If want the backslash included in the result then you would remove the "+ 1" but you would then need to include some error handling incase your string did not contain "/". Regards Rowan mjack003 wrote: That works great but I don't think I was very clear. I need everything after the "/" backslash. So is there a way to omit everything before that character and save only the remaining part? Thanks for the input, Mjack |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Summing partial strings. | Excel Worksheet Functions | |||
Looking up a string of text within a string of text | Excel Worksheet Functions | |||
Auto convert an alphanumeric string (CIS9638S) to numbers only? | Excel Worksheet Functions | |||
Inserting Filtered RC cell information into other worksheets | Excel Discussion (Misc queries) | |||
How do I use 3 cells to create the string for a lookup function? | Excel Worksheet Functions |