Insert Charters into a number string vba or formula?

irrefutable14

New Member
Joined
Mar 2, 2017
Messages
25
I'd like to update a string of numbers and add charters before each string of numbers. IE

006-01-00-00
R006-B01-S00-P00
006-01-01-00
R006-B01-S01-P00

<tbody>
</tbody>

:confused:
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
If your inputs are always text strings in exactly the format 000-00-00-00 and the characters to be inserted are always R, B, S, P in exactly those positions, then you can do it like this

="R"&left(a1,4)&"B"&mid(a1,5,3)...and so on.

If there is more variety to your situation, you'll need something more complicated.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,901
Messages
6,122,157
Members
449,068
Latest member
shiz11713

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top