Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Print Macro Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
access user - 19 Mar 2008 12:29 GMT
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
Jim Cone - 19 Mar 2008 12:52 GMT
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
Signature

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

access user - 19 Mar 2008 14:23 GMT
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

> Dots, dots, dots...
>
[quoted text clipped - 6 lines]
> End With
> End Sub
Jim Cone - 19 Mar 2008 14:36 GMT
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
Signature

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...
>
[quoted text clipped - 6 lines]
> End With
> End Sub
access user - 19 Mar 2008 15:01 GMT
Thanks Jim.
James

>  
> Dots connect objects with their properties and methods.
[quoted text clipped - 12 lines]
> > End With
> > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.