|
|
Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
I just need to know, if I create a button in excel sheet, what forumla I have to put in VB for it to print?
|
|
Rizwan, do you want the button to print out? If so if its from the control tool box it will print by default, if it is from the forms toolbar right click on it, format control, properties, check print object. If you need code to print the sheet, or workbook record a macro when you print and use the button to run the code. If you need any more help post back with more details
-- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003
"Rizwan" <Rizwan[ at ]discussions.microsoft.com> wrote in message news:CC94CD0E-B1C1-4CAC-9C1D-BB8E49D525DD[ at ]microsoft.com...
[Quoted Text] > I just need to know, if I create a button in excel sheet, what forumla I
have > to put in VB for it to print?
|
|
Thanks Paul. What I am looking for is the code I will put in Macro, I beleive there is a function, what is it?
Thanks for the reply...
"Paul B" wrote:
[Quoted Text] > Rizwan, do you want the button to print out? If so if its from the control > tool box it will print by default, if it is from the forms toolbar right > click on it, format control, properties, check print object. If you need > code to print the sheet, or workbook record a macro when you print and use > the button to run the code. If you need any more help post back with more > details > > -- > Paul B > Always backup your data before trying something new > Please post any response to the newsgroups so others can benefit from it > Feedback on answers is always appreciated! > Using Excel 2002 & 2003 > > "Rizwan" <Rizwan[ at ]discussions.microsoft.com> wrote in message > news:CC94CD0E-B1C1-4CAC-9C1D-BB8E49D525DD[ at ]microsoft.com... > > I just need to know, if I create a button in excel sheet, what forumla I > have > > to put in VB for it to print? > > >
|
|
Rizwan, I am not sure what you what,
This will set button 1 from the forms toolbar to print
ActiveSheet.Shapes("Button 1").Select With Selection .PrintObject = True End With
This will print the sheet
ActiveSheet.PrintOut Copies:=1, Collate:=False
Is this what you need?
-- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003
"Rizwan" <Rizwan[ at ]discussions.microsoft.com> wrote in message news:B5298C36-2F77-40C1-BFD3-04AA979EE8C0[ at ]microsoft.com...
[Quoted Text] > Thanks Paul. What I am looking for is the code I will put in Macro, I
beleive > there is a function, what is it? > > Thanks for the reply... > > "Paul B" wrote: > > > Rizwan, do you want the button to print out? If so if its from the control > > tool box it will print by default, if it is from the forms toolbar right > > click on it, format control, properties, check print object. If you need > > code to print the sheet, or workbook record a macro when you print and use > > the button to run the code. If you need any more help post back with more > > details > > > > -- > > Paul B > > Always backup your data before trying something new > > Please post any response to the newsgroups so others can benefit from it > > Feedback on answers is always appreciated! > > Using Excel 2002 & 2003 > > > > "Rizwan" <Rizwan[ at ]discussions.microsoft.com> wrote in message > > news:CC94CD0E-B1C1-4CAC-9C1D-BB8E49D525DD[ at ]microsoft.com... > > > I just need to know, if I create a button in excel sheet, what forumla I > > have > > > to put in VB for it to print? > > > > > >
|
|
Yes, it worked. Thanks for the reply...
"Paul B" wrote:
[Quoted Text] > Rizwan, I am not sure what you what, > > This will set button 1 from the forms toolbar to print > > ActiveSheet.Shapes("Button 1").Select > With Selection > .PrintObject = True > End With > > This will print the sheet > > ActiveSheet.PrintOut Copies:=1, Collate:=False > > Is this what you need? > > -- > Paul B > Always backup your data before trying something new > Please post any response to the newsgroups so others can benefit from it > Feedback on answers is always appreciated! > Using Excel 2002 & 2003 > > "Rizwan" <Rizwan[ at ]discussions.microsoft.com> wrote in message > news:B5298C36-2F77-40C1-BFD3-04AA979EE8C0[ at ]microsoft.com... > > Thanks Paul. What I am looking for is the code I will put in Macro, I > beleive > > there is a function, what is it? > > > > Thanks for the reply... > > > > "Paul B" wrote: > > > > > Rizwan, do you want the button to print out? If so if its from the > control > > > tool box it will print by default, if it is from the forms toolbar right > > > click on it, format control, properties, check print object. If you need > > > code to print the sheet, or workbook record a macro when you print and > use > > > the button to run the code. If you need any more help post back with > more > > > details > > > > > > -- > > > Paul B > > > Always backup your data before trying something new > > > Please post any response to the newsgroups so others can benefit from it > > > Feedback on answers is always appreciated! > > > Using Excel 2002 & 2003 > > > > > > "Rizwan" <Rizwan[ at ]discussions.microsoft.com> wrote in message > > > news:CC94CD0E-B1C1-4CAC-9C1D-BB8E49D525DD[ at ]microsoft.com... > > > > I just need to know, if I create a button in excel sheet, what forumla > I > > > have > > > > to put in VB for it to print? > > > > > > > > > > > >
|
|
|