Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro print range

I have a spread sheet that I would like to print columns
D to J starting with row 10. The number of rows that
have information in them will be different every time. I
would only like to print the number of rows that have
data in them. Please help me with writting a macro to
preform this action. Thank you very much.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Macro print range

One way:

Public Sub PrintDtoJ()
Dim nLastRow As Long
Dim i As Long

nLastRow = 10
For i = 4 to 10
nLastRow = Application.Max(nLastRow, _
Cells(Rows.Count, i).End(xlUp).Row)
Next i
With ActiveSheet
.PageSetup.PrintArea = "D10:J" & nLastRow
.PrintOut
End With
End Sub


In article ,
"Shawn" wrote:

I have a spread sheet that I would like to print columns
D to J starting with row 10. The number of rows that
have information in them will be different every time. I
would only like to print the number of rows that have
data in them. Please help me with writting a macro to
preform this action. Thank you very much.

Reply
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
Macro to print a cell range Tamsyn Excel Discussion (Misc queries) 2 November 24th 08 04:48 PM
print out specified range in macro Wu Excel Discussion (Misc queries) 1 May 25th 08 09:14 AM
Macro print range not dynamic like I wanted it to be TRYING Excel Worksheet Functions 8 November 27th 07 01:05 AM
Macro to set print range Brisbane Rob New Users to Excel 2 September 4th 05 03:50 AM
Print range macro nc Excel Discussion (Misc queries) 3 March 21st 05 04:38 PM


All times are GMT +1. The time now is 09:28 AM.

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

About Us

"It's about Microsoft Excel"