Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
My company generates reports that need to be formatted before being sent to clients. They can be anywhere from 2 pages to over 200 (all on one worksheet) depending on the data, but are typically under 30 pages. The formatting for each page will be the same (columns are different from each other, but all pages will look similar). Each page contains anywhere from 1 to 10 rows, and 8 to 25 or so columns. I would like to set up a macro that, after clicking on the upper left most cell of the area needing formatting, would then a) count the number of rows with values in them; b) count the number of columns with values; c) select this combination of rows and columns in sections; and d) apply certain borders to each section. I was able to set up a macro for one page within the worksheet, but not every page has the same number of rows and columns so obviously it doesn't work on every page. This is what I have for that one page (I took out the actual format wording because it was so lengthy and not really important to the bulk of the formula): This particular macro is set up for 10 rows and 18 columns. Sub Macro19() ActiveCell.Offset(2, 0).Select ActiveCell.Resize(8, 1).Select 'here is where I apply my formatting ActiveCell.Offset(0, 1).Select ActiveCell.Resize(8, 2).Select 'application of formatting ActiveCell.Offset(-2, 5).Select ActiveCell.Resize(2, 10).Select 'application of formatting ActiveCell.Offset(2, 0).Select ActiveCell.Resize(8, 10).Select 'more formatting End Sub Thanks in advance! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count Ranges Q | Excel Worksheet Functions | |||
Count age ranges | Excel Worksheet Functions | |||
count age ranges | Excel Discussion (Misc queries) | |||
count if in two ranges | Excel Discussion (Misc queries) | |||
count date ranges | Excel Worksheet Functions |