ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help (https://www.excelbanter.com/excel-programming/358487-need-help.html)

Ernie

Need help
 
'// Print the selected page
ActiveSheet.PrintOut From:=1, To:=5, _
Copies:=1

My workbook calculates the total number of pages automatically and that
number is in cell 'G6' i need the printout code to pick up the value in cell
'G6' for the "To:". for example cell G6 =6, how do i get the value 6 to
automatically go in the formula.

--
help a friend help you

Tom Ogilvy

Need help
 
'// Print the selected page
ActiveSheet.PrintOut From:=1, _
To:=Activesheet.Range("G6").Value, _
Copies:=1


"ernie" wrote:

'// Print the selected page
ActiveSheet.PrintOut From:=1, To:=5, _
Copies:=1

My workbook calculates the total number of pages automatically and that
number is in cell 'G6' i need the printout code to pick up the value in cell
'G6' for the "To:". for example cell G6 =6, how do i get the value 6 to
automatically go in the formula.

--
help a friend help you


Don Guillett

Need help
 
try
Sub printit()
with activesheet
mynum =.Range("g3")
..PrintOut From:=1, To:=mynum
end with
End Sub

--
Don Guillett
SalesAid Software

"ernie" wrote in message
...
'// Print the selected page
ActiveSheet.PrintOut From:=1, To:=5, _
Copies:=1

My workbook calculates the total number of pages automatically and that
number is in cell 'G6' i need the printout code to pick up the value in
cell
'G6' for the "To:". for example cell G6 =6, how do i get the value 6 to
automatically go in the formula.

--
help a friend help you





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com