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

Hi

My print macro works if I run it from the sheet that I want to print, but if
I am on another sheet, it appears to do nothing. I actually want a button on
another sheet and want to print the sheet in question, without having to
select that sheet first. My macro is below:

Sub PrintAll()
With Sheets("CoverSheet")
For i = 1 To Range("D48")

Range("N1").Value = i
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Next i
End With
End Sub

Any ideas?
tia
James
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Print Macro Problem

Dots, dots, dots...

Sub PrintAll()
With Sheets("CoverSheet")
For i = 1 To .Range("D48")
.Range("N1").Value = i
.PrintOut Copies:=1, Collate:=True
Next i
End With
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"access user"
wrote in message
Hi
My print macro works if I run it from the sheet that I want to print, but if
I am on another sheet, it appears to do nothing. I actually want a button on
another sheet and want to print the sheet in question, without having to
select that sheet first. My macro is below:

Sub PrintAll()
With Sheets("CoverSheet")
For i = 1 To Range("D48")

Range("N1").Value = i
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Next i
End With
End Sub

Any ideas?
tia
James
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Print Macro Problem

I see the point Jim :-)

What do those dots mean? It works now but just curious as to why those dots
are so important.

thanks
James

"Jim Cone" wrote:

Dots, dots, dots...

Sub PrintAll()
With Sheets("CoverSheet")
For i = 1 To .Range("D48")
.Range("N1").Value = i
.PrintOut Copies:=1, Collate:=True
Next i
End With
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"access user"
wrote in message
Hi
My print macro works if I run it from the sheet that I want to print, but if
I am on another sheet, it appears to do nothing. I actually want a button on
another sheet and want to print the sheet in question, without having to
select that sheet first. My macro is below:

Sub PrintAll()
With Sheets("CoverSheet")
For i = 1 To Range("D48")

Range("N1").Value = i
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Next i
End With
End Sub

Any ideas?
tia
James

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Print Macro Problem


Dots connect objects with their properties and methods.
With Sheets("CoverSheet")
Range("D48") 'is on the active sheet.
.Range("D48") 'is on Sheets("CoverSheet")
End With
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"access user"
wrote in message
I see the point Jim :-)

What do those dots mean? It works now but just curious as to why those dots
are so important.
thanks
James



"Jim Cone" wrote:
Dots, dots, dots...

Sub PrintAll()
With Sheets("CoverSheet")
For i = 1 To .Range("D48")
.Range("N1").Value = i
.PrintOut Copies:=1, Collate:=True
Next i
End With
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"access user"
wrote in message
Hi
My print macro works if I run it from the sheet that I want to print, but if
I am on another sheet, it appears to do nothing. I actually want a button on
another sheet and want to print the sheet in question, without having to
select that sheet first. My macro is below:

Sub PrintAll()
With Sheets("CoverSheet")
For i = 1 To Range("D48")

Range("N1").Value = i
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Next i
End With
End Sub

Any ideas?
tia
James

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Print Macro Problem

Thanks Jim.
James

"Jim Cone" wrote:


Dots connect objects with their properties and methods.
With Sheets("CoverSheet")
Range("D48") 'is on the active sheet.
.Range("D48") 'is on Sheets("CoverSheet")
End With
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"access user"
wrote in message
I see the point Jim :-)

What do those dots mean? It works now but just curious as to why those dots
are so important.
thanks
James



"Jim Cone" wrote:
Dots, dots, dots...

Sub PrintAll()
With Sheets("CoverSheet")
For i = 1 To .Range("D48")
.Range("N1").Value = i
.PrintOut Copies:=1, Collate:=True
Next i
End With
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"access user"
wrote in message
Hi
My print macro works if I run it from the sheet that I want to print, but if
I am on another sheet, it appears to do nothing. I actually want a button on
another sheet and want to print the sheet in question, without having to
select that sheet first. My macro is below:

Sub PrintAll()
With Sheets("CoverSheet")
For i = 1 To Range("D48")

Range("N1").Value = i
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Next i
End With
End Sub

Any ideas?
tia
James


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 hide rows with a certain cell empty then set print area and print tahrah Excel Programming 12 January 9th 07 03:47 AM
Print Macro Problem Graham Haughs Excel Discussion (Misc queries) 2 March 2nd 06 02:40 PM
Pivot Table macro to set print area and print details of drill down data Steve Haskins Excel Discussion (Misc queries) 2 December 28th 05 04:59 PM
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM
Need Help w/ Print Macro to Print All Visible Sheets (including Charts) in a Workbook will Excel Programming 3 September 23rd 04 08:05 PM


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