Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 333
Default Finding Print Range

Hi,

I've been bouncing around researching this and it's just not coming together.

Here's what I need to do.

I have a range from E1:H90. However, below E9 I need to end the print range
when I have 2 sequential empty cells.

Here's the code I have so far:


Sub PrintDoc1()
'
' PrintDoc1 Macro
' Dim LastRow As Long

LastRow = Worksheets("Sheet1").Range("E9").End(xlDown).Row + 1
Range("E1:"&LastRow).Select
Selection.PrintOut Copies:=1, Collate:=True

End Sub

1. This doesn't work
2 How do I check for 2 sequential empty cells below E9?
3. How do I tell it to only print columns E through H?

I would need this to work for whatever is the active worksheet.

Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 333
Default Finding Print Range

Ok, I've got this much to work:

Sub PrintDoc1()
'
' PrintDoc1 Macro
Dim FirstRow As Long
Dim LastRow As Long

LastRow = Worksheets("Day One").Range("E9").End(xlDown).Row + 1
Range("E1:" & "H" & LastRow).Select
Selection.PrintOut Copies:=1, Collate:=True

End Sub


Now, how do I check for 2 sequential empty cells below E9 and how do I tell
it to use the active worksheet?

I'm jazzed!

Thanks!




"Karen53" wrote:

Hi,

I've been bouncing around researching this and it's just not coming together.

Here's what I need to do.

I have a range from E1:H90. However, below E9 I need to end the print range
when I have 2 sequential empty cells.

Here's the code I have so far:


Sub PrintDoc1()
'
' PrintDoc1 Macro
' Dim LastRow As Long

LastRow = Worksheets("Sheet1").Range("E9").End(xlDown).Row + 1
Range("E1:"&LastRow).Select
Selection.PrintOut Copies:=1, Collate:=True

End Sub

1. This doesn't work
2 How do I check for 2 sequential empty cells below E9?
3. How do I tell it to only print columns E through H?

I would need this to work for whatever is the active worksheet.

Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 333
Default Finding Print Range

Hi,

Ok, now I have the active sheet worked out.

Sub PrintDoc1()
'
' PrintDoc1 Macro
'
Dim LastRow As Long

LastRow = ActiveSheet.Range("E9").End(xlDown).Row + 1
Range("E1:" & "H" & LastRow).Select
Selection.PrintOut Copies:=1, Collate:=True

End Sub

I'm really stumped on the 2 sequential empty cells.

Thanks!


"Karen53" wrote:

Hi,

I've been bouncing around researching this and it's just not coming together.

Here's what I need to do.

I have a range from E1:H90. However, below E9 I need to end the print range
when I have 2 sequential empty cells.

Here's the code I have so far:


Sub PrintDoc1()
'
' PrintDoc1 Macro
' Dim LastRow As Long

LastRow = Worksheets("Sheet1").Range("E9").End(xlDown).Row + 1
Range("E1:"&LastRow).Select
Selection.PrintOut Copies:=1, Collate:=True

End Sub

1. This doesn't work
2 How do I check for 2 sequential empty cells below E9?
3. How do I tell it to only print columns E through H?

I would need this to work for whatever is the active worksheet.

Thanks in advance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default Finding Print Range

Karen, does this help? James

LastRow = [e9].Row
While Cells(LastRow, "e").Offset(2) < ""
LastRow = Cells(LastRow, "e").End(xlDown).Row
Wend

"Karen53" wrote in message
...
Hi,

Ok, now I have the active sheet worked out.

Sub PrintDoc1()
'
' PrintDoc1 Macro
'
Dim LastRow As Long

LastRow = ActiveSheet.Range("E9").End(xlDown).Row + 1
Range("E1:" & "H" & LastRow).Select
Selection.PrintOut Copies:=1, Collate:=True

End Sub

I'm really stumped on the 2 sequential empty cells.

Thanks!


"Karen53" wrote:

Hi,

I've been bouncing around researching this and it's just not coming
together.

Here's what I need to do.

I have a range from E1:H90. However, below E9 I need to end the print
range
when I have 2 sequential empty cells.

Here's the code I have so far:


Sub PrintDoc1()
'
' PrintDoc1 Macro
' Dim LastRow As Long

LastRow = Worksheets("Sheet1").Range("E9").End(xlDown).Row + 1
Range("E1:"&LastRow).Select
Selection.PrintOut Copies:=1, Collate:=True

End Sub

1. This doesn't work
2 How do I check for 2 sequential empty cells below E9?
3. How do I tell it to only print columns E through H?

I would need this to work for whatever is the active worksheet.

Thanks in advance.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 333
Default Finding Print Range

Yes, James! Thank you!!

"Zone" wrote:

Karen, does this help? James

LastRow = [e9].Row
While Cells(LastRow, "e").Offset(2) < ""
LastRow = Cells(LastRow, "e").End(xlDown).Row
Wend

"Karen53" wrote in message
...
Hi,

Ok, now I have the active sheet worked out.

Sub PrintDoc1()
'
' PrintDoc1 Macro
'
Dim LastRow As Long

LastRow = ActiveSheet.Range("E9").End(xlDown).Row + 1
Range("E1:" & "H" & LastRow).Select
Selection.PrintOut Copies:=1, Collate:=True

End Sub

I'm really stumped on the 2 sequential empty cells.

Thanks!


"Karen53" wrote:

Hi,

I've been bouncing around researching this and it's just not coming
together.

Here's what I need to do.

I have a range from E1:H90. However, below E9 I need to end the print
range
when I have 2 sequential empty cells.

Here's the code I have so far:


Sub PrintDoc1()
'
' PrintDoc1 Macro
' Dim LastRow As Long

LastRow = Worksheets("Sheet1").Range("E9").End(xlDown).Row + 1
Range("E1:"&LastRow).Select
Selection.PrintOut Copies:=1, Collate:=True

End Sub

1. This doesn't work
2 How do I check for 2 sequential empty cells below E9?
3. How do I tell it to only print columns E through H?

I would need this to work for whatever is the active worksheet.

Thanks in advance.






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default Finding Print Range

You're welcome! And thanks for the feedback.
"Karen53" wrote in message
...
Yes, James! Thank you!!

"Zone" wrote:

Karen, does this help? James

LastRow = [e9].Row
While Cells(LastRow, "e").Offset(2) < ""
LastRow = Cells(LastRow, "e").End(xlDown).Row
Wend

"Karen53" wrote in message
...
Hi,

Ok, now I have the active sheet worked out.

Sub PrintDoc1()
'
' PrintDoc1 Macro
'
Dim LastRow As Long

LastRow = ActiveSheet.Range("E9").End(xlDown).Row + 1
Range("E1:" & "H" & LastRow).Select
Selection.PrintOut Copies:=1, Collate:=True

End Sub

I'm really stumped on the 2 sequential empty cells.

Thanks!


"Karen53" wrote:

Hi,

I've been bouncing around researching this and it's just not coming
together.

Here's what I need to do.

I have a range from E1:H90. However, below E9 I need to end the print
range
when I have 2 sequential empty cells.

Here's the code I have so far:


Sub PrintDoc1()
'
' PrintDoc1 Macro
' Dim LastRow As Long

LastRow = Worksheets("Sheet1").Range("E9").End(xlDown).Row +
1
Range("E1:"&LastRow).Select
Selection.PrintOut Copies:=1, Collate:=True

End Sub

1. This doesn't work
2 How do I check for 2 sequential empty cells below E9?
3. How do I tell it to only print columns E through H?

I would need this to work for whatever is the active worksheet.

Thanks in advance.






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
Not finding file to print pdberger Excel Programming 3 June 23rd 07 02:15 AM
Print Blank Pgs - Preview margins outside print range dsm Excel Discussion (Misc queries) 0 October 25th 06 06:17 PM
Can you get the range reference for each page in a worksheet print range? Crosby Excel Programming 3 April 12th 05 06:06 PM
Finding the current "print range" Alex T Excel Programming 1 September 2nd 04 01:38 PM
Excel 2000 VBA - Set Print Range in dynamic range sub_pop[_5_] Excel Programming 2 July 27th 04 08:01 PM


All times are GMT +1. The time now is 11:54 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"