ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   do you know how to take out the 011 from this number:011548926 in. (https://www.excelbanter.com/excel-programming/313230-do-you-know-how-take-out-011-number-011548926-a.html)

reggy

do you know how to take out the 011 from this number:011548926 in.
 


Rob van Gelder[_4_]

do you know how to take out the 011 from this number:011548926 in.
 
Dont know what you want...

Remove 011 or keep 011?

Two examples - you choose.

Sub test1()
Dim str As String
str = "011548926 in."

str = Left(str, 3)
MsgBox str
End Sub

Sub test2()
Dim str As String
str = "011548926 in."

str = Mid(Split(str, " ", 2)(0), 4)
MsgBox str
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"reggy" wrote in message
...




Tom Ogilvy

do you know how to take out the 011 from this number:011548926 in.
 
Dim sStr as String
sStr = "011548926 in"
sStr = Application.Substitute(sStr,"011","")
msgbox sStr

--
Regards,
Tom Ogilvy



"reggy" wrote in message
...





All times are GMT +1. The time now is 12:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com