hi everyone, does anyone know how to write code that would identify string and integer within one piece of data from a textbox, so that i can use the string part of the data, thank you!
hi everyone, does anyone know how to write code that would identify string and integer within one piece of data from a textbox, so that i can use the string part of the data, thank you!
try this piece of code,
![]()
Sub split_textbox() 'code by xlbiznes Dim str As String Dim num As String For x = 1 To Len(TextBox1.Text) If IsNumeric(Mid(TextBox1.Text, x, 1)) = True Then num = num & Mid(TextBox1.Text, x, 1) Else str = str & Mid(TextBox1.Text, x, 1) End If Next MsgBox "This is the string part of your textbox :" & str & vbCrLf & "This is the numeric part of your textbox " & num, vbInformation, "Xlbiznes" End Sub
Happy Computing ,
Xlbiznes.
To show your appreciation please click *
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks