LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Pank
 
Posts: n/a
Default Help with Macro Please

I have recorded the following macro that will set the print area for a
particular sheet:-

Sub Pset()
Range("A1:K1").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$K$14"
End Sub

What I want is to automate this process for all sheets within a workbook.

What I intending to do was:-

For Each wks In ActiveWorkbook.Worksheets
Range("A1:K1").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$K$14"

As the print area within each sheet is different how do I replace the
"$A$1:$K$14" that is currently in the macro?


Additionally, having set the print area, I want to add the word TOTAL in the
last used cell +1 in Column A and the following formula in the adjacent cell
in column B =COUNTROWS(A:A) €“ 2. Again this needs to be done on all sheets
within the book.

Your help is appreciated.

 
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
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
automatic macro update boconnell Excel Worksheet Functions 4 February 9th 05 07:10 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


All times are GMT +1. The time now is 03:14 PM.

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"