How to ensure that an Excel table is properly formatted, both in values and background?

Mr. Snrub

Board Regular
Joined
May 22, 2005
Messages
147
Office Version
  1. 365
Platform
  1. Windows
As I understand it, an Excel table can only be formatted at the time it's created. If you want to change the number format of a column, you have to convert it to a Range, and then convert it back to a table. The problem with this is once you turn it to a range, the background colors of your table get applied to the cells. Then when you convert it back to a table, you've got the formatting of the table, plus the background colors of the cells. This is unnecessary overhead, and also if you try to fill down any values in the cells, you'll get the same background color of the first cell you fill. This is bad! I feel like what I need to do to fix all this is the following:

1. Copy-and-paste the Values And Number Formatting of the entire table to an unused and unformatted area of the worksheet.
2. Ensure that all the recently-pasted cells in the new area are the correct number formats so that new rows will have the correct formats.
3. Select the cells of the new table and format it as a table. Keeping the default name Table1.
4. Rename the original excel table to a temp value, such as GarbageTable.
5. Rename the new excel table from Table1 to whatever the original correct table name is.
6. Delete the original GarbageTable's cells such that the new table occupies the same space as the original table did.

This will be very time-consuming for a workbook with multiple tables. Is there a better approach?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
You can select numbers in a excel table and format them, change the cell format from general to number. Are you talking about something else?
 
Upvote 0
If you create a new row in the excel table it will NOT adopt the number formatting of the last row. Instead it will adopt the formatting of whatever the last row's cells were when the table was created.
 
Upvote 0
I create this

Excel 2010
ABCD
1Header1Header2Header3Header4
2DATA1691912833179
3DATA2158663127777
4DATA3671930681137
5DATA4165614071400
6DATA5742274563364
7DATA6517272981510
8DATA7534333314
9DATA863781295170

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>
Sheet7



After tuning it into a table I select B2:B9 and format as number with 2 decimal places and thousand separate. When I add another row and get the number format in that column.

Excel 2010
ABCD
1Header1Header2Header3Header4
2DATA16,919.0012833179
3DATA21,586.0063127777
4DATA36,719.0030681137
5DATA41,656.0014071400
6DATA57,422.0074563364
7DATA65,172.0072981510
8DATA75,343.0033314
9DATA86,378.001295170
10data966.0059

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>
Sheet7

As you can see I get 66.00 instead of 66 since the cell is formatted as a number. I am unable to recreate the behavior you are seeing. Maybe someone else can.
 
Upvote 0

Forum statistics

Threads
1,214,394
Messages
6,119,263
Members
448,881
Latest member
Faxgirl

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