Numbers digits

Panoos64

Well-known Member
Joined
Mar 1, 2014
Messages
882
Hi to all of you,
I would like to use a VBA code so that, to arrange the numbers in column “C” up to 7 digits and placed the letter “I” and “-“ at left side. Therefore that in case that, the number doesn't contains 7 digits should place "0" so that to complete it. I present below an extract of original data and expected result. Thank you all in advance.

Original data


1610956629689.png


Expected result


1610956649889.png
 
Thank you Navic, the formula works perfect. Thank for your time spent for my project. Hv a nice day
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi Rick, i tested once again and still have the same issue, but do not be so worry. I just say it for feedback purposes. Maybe is due to my office version and therefore that, i use office 2016. Thank you once again for your support. Hv a great day
 
Last edited:
Upvote 0
I am not sure why, but I thought you wanted a VBA solution. If a formula solution is acceptable, there is a much simpler one that you can use...
Excel Formula:
=TEXT(C2,"I-0000000")
 
Upvote 0
Thank you Rick! it works by your formula. I thank you once again for your kindness to resolve my project. Hv a lovely day!
 
Upvote 0

Forum statistics

Threads
1,214,822
Messages
6,121,772
Members
449,049
Latest member
greyangel23

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