P
Paul
Hi all,
I have been trying to find the answer for this question for a long
time. I have a userform that contains textbox2 and textbox 3.
A user can copy and paste (yes I did find how to add the menu items
for copy and paste in a userform) a certain line of text in textbox2.
This will look like this:
texttexttexttext item number: 9876543210
I want a macro that finds the text "item number: " and deletes it from
textbox2, something like:
If InStr(1, TextBox2.Value, "Item number: ", vbTextCompare) > 0 Then
TextBox2.Value = ... (TextBox2.Value minus "Item number: ")
Furthermore, I want it to find the item number, 9876543210 which can
be any number but will always have 10 digits, after which this item
number is put in textbox3. To make it even more complicated, the
string texttexttexttext may also contain one or two numbers but never
10 digits in a row.
What may help is that the text string as I just gave will always be in
that format, so the item number will always be at the end of the
textbox string.
I hope somebody can help me with this, I am not that experienced in
vba yet...
Thanks in advance,
Paul
I have been trying to find the answer for this question for a long
time. I have a userform that contains textbox2 and textbox 3.
A user can copy and paste (yes I did find how to add the menu items
for copy and paste in a userform) a certain line of text in textbox2.
This will look like this:
texttexttexttext item number: 9876543210
I want a macro that finds the text "item number: " and deletes it from
textbox2, something like:
If InStr(1, TextBox2.Value, "Item number: ", vbTextCompare) > 0 Then
TextBox2.Value = ... (TextBox2.Value minus "Item number: ")
Furthermore, I want it to find the item number, 9876543210 which can
be any number but will always have 10 digits, after which this item
number is put in textbox3. To make it even more complicated, the
string texttexttexttext may also contain one or two numbers but never
10 digits in a row.
What may help is that the text string as I just gave will always be in
that format, so the item number will always be at the end of the
textbox string.
I hope somebody can help me with this, I am not that experienced in
vba yet...
Thanks in advance,
Paul