Formatting Help

tburch98

New Member
Joined
Jun 18, 2014
Messages
2
Hi I am working on a file that is filled from an Access database. The excel file has multiple tabs with a simple format with a "header", "data" and a "total" line. When the files are updated the formatting tends to get messed up. The data section changes based on the number of cases pulled in from Access. Is there a macro that will keep specific formatting for the data section and a separate formatting for the total line?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
There are ways of doing this.

For the header, if your header is always in row 1, and row 1 only, then it's simple to write code that will format row 1 the way you want it.
If you're not sure how to do this, try using the macro recorder while you actually apply the format you want to row 1.
That should give you usable code.

For the total line, you need to find some way of identifying which line is the total.
For example, it might be the row that contains the word "TOTAL" in a specific column.
OR, you might be able to count the number of occupied rows, and use that to determine the position of the total row.
Once you've done that, you can then apply the "total" format to the line that you have identified as the total.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,170
Members
453,021
Latest member
Justyna P

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