macro assigned to print command button

G

Guest

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
 
G

Guest

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

Guest

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?
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top