Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default macro assigned to print command button

i have assigned a macro to the print command, (filename is file1.) if i open
another excel spreadsheet (book1 or filename2,) the macro is still assigned
to the print button.

can the print button be reset to set the default command (print)after the
macro has been executed?

jat jaswal
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default macro assigned to print command button

If ActiveSheet.FileName = C:\MyDocuments\file1 Then
MyMacro ' Whatever your macro does
Else
Exit Sub
End If



"jatman" wrote:

i have assigned a macro to the print command, (filename is file1.) if i open
another excel spreadsheet (book1 or filename2,) the macro is still assigned
to the print button.

can the print button be reset to set the default command (print)after the
macro has been executed?

jat jaswal

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default macro assigned to print command button

If you want the active sheet to print, then change the Exit Sub to
ActiveSheet.PrintOut

I'm wondering why you would tie another macro to the print button. Does it
restrict the printing or specify a particular printer?

"jatman" wrote:

i have assigned a macro to the print command, (filename is file1.) if i open
another excel spreadsheet (book1 or filename2,) the macro is still assigned
to the print button.

can the print button be reset to set the default command (print)after the
macro has been executed?

jat jaswal

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default macro assigned to print command button

it's used to restrict the printing. i want the macro to work from the print
button on a purchase order (instead of a big ugly command button in the
middle of the screen.) by doing it like this, when they print the purchase
order, it does everything (prints, saves, emails, rolls the count sequence on
the po #.)

i'll try this next week.

thank you
jatman


"JLGWhiz" wrote:

If you want the active sheet to print, then change the Exit Sub to
ActiveSheet.PrintOut

I'm wondering why you would tie another macro to the print button. Does it
restrict the printing or specify a particular printer?

"jatman" wrote:

i have assigned a macro to the print command, (filename is file1.) if i open
another excel spreadsheet (book1 or filename2,) the macro is still assigned
to the print button.

can the print button be reset to set the default command (print)after the
macro has been executed?

jat jaswal

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
Command Button - Macro to print to pdf, then send pdf to email. Tdahlman Excel Discussion (Misc queries) 2 May 1st 23 11:44 AM
Use Macro To Change Which Macro Assigned To Command Button CVinje Excel Discussion (Misc queries) 0 May 25th 10 09:55 PM
Macro assigned to a button Sadcrab Excel Discussion (Misc queries) 12 December 8th 06 11:16 PM
Macro Assigned to a Button zephyr Excel Discussion (Misc queries) 1 October 25th 06 03:33 PM
How do I know what macro is assigned to a button? Denise in NC Excel Discussion (Misc queries) 3 April 3rd 06 02:31 PM


All times are GMT +1. The time now is 04:58 PM.

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"