View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pierre via OfficeKB.com[_2_] Pierre via OfficeKB.com[_2_] is offline
external usenet poster
 
Posts: 122
Default printing a range that changes all the time

Hi experts,

I have data starting from A1 to M...
I would like to count the rows to print based on the input in column B !!!

I have the following code for printing a range.

Dim rngprint As Range
Sheets("Outputdlnrs").Select
Set rngprint = Range("A1", Range("A1").End(xlDown).Address)
ActiveSheet.PageSetup.PrintArea = rngprint.Address
Selection.PrintPreview

This does not work because only A1 is selected each time.

Does anybody have the right formula ?

Thanks,
Pierre


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1