Padding Number Format with Spaces

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
2,758
Office Version
  1. 365
Platform
  1. Windows
Is there a number format or conditional formatting that can pad any alphanumeric value with spaces? I create a lot of Excel Forms. I want the empty cell to display as underline and I want the underline to show the full width of the cell. I know I can put spaces in the cell and it will show the underline. When a user enters a number or text in a cell, only the characters show underline. I have tried this number format:
General" "
It works when a number is entered into the cell, but not with text.

Jeff
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
It works when a number is entered into the cell, but not with text.
That is correct. Formatting only applies to numeric entries, not text ones (and alphanumeric entries would be considered text entries).
I think what you want to do would probably require VBA.
 
Last edited:
Upvote 0
The two alternatives are 1) putting a Line shape below the text (once the sheet is locked the shape can't be selected or moved). 2) Using VBA to add the spaces at the end (more complicated). Using borders is not an option because the line merges right into the next cell and doesn't look like an underline.
 
Upvote 0
I probably opt for the second option.

Personally, I despise Excel forms. They are so cumbersome to work with. Give me an Access form any day, where you can "bind" the form to a Table or Query, so you do not need to explicitly map every field and value in VBA!
 
Upvote 0

Forum statistics

Threads
1,214,528
Messages
6,120,065
Members
448,942
Latest member
sharmarick

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