LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default count if and format ranges

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Ranges Q Seanie Excel Worksheet Functions 2 January 15th 09 04:20 PM
Count age ranges James Excel Worksheet Functions 8 November 9th 07 08:04 PM
count age ranges Clash Excel Discussion (Misc queries) 3 June 13th 06 03:05 PM
count if in two ranges TUNGANA KURMA RAJU Excel Discussion (Misc queries) 0 October 8th 05 04:47 AM
count date ranges murtaza Excel Worksheet Functions 4 July 18th 05 04:29 PM


All times are GMT +1. The time now is 08:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"