Padding Spaces onto a Cell

hcabs99

Active Member
Joined
May 9, 2006
Messages
257
Hi

Can anyone help with what im sure is a simple answer, but i am stuck!

I need to create a lot of data which needs to have a fixed length for the cells but the data being entered does not always fit this length. I therefore need to pad these cells out to always ensure they are the correct size. I know how to remove spaces using trim but cannot find a way of reversing it

Any help would be gratefully appreciated

Cheers

Phil
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi Phil

For ex. if you want a fixed length of 10, assuming you want to left pad with spaces:

=RIGHT(REPT(" ",10)&A1,10)
 
Upvote 0
Hi Pedro :)

It would never strike my mind to use REPT() !! You guys read out the possible solution in a fraction of a second :biggrin:
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

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