Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to print a cell range | Excel Discussion (Misc queries) | |||
print out specified range in macro | Excel Discussion (Misc queries) | |||
Macro print range not dynamic like I wanted it to be | Excel Worksheet Functions | |||
Macro to set print range | New Users to Excel | |||
Print range macro | Excel Discussion (Misc queries) |