Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing solution
I have group box with five option buttons, let's say they are called 1,2,3,4
and 5. Then I also have a button named Print. I would like to give the user the opportunity to choose one of the option buttons and then press Print so the particular sheet/part of sheet named in the option button gets printed. Does anyone know VBA code for how to do this? Would appreciate it!! Andreas |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing solution
Do you use Forms Option buttons ?
In the properties set a linked cell Check the value of the cell in your code -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Andreas" wrote in message ... I have group box with five option buttons, let's say they are called 1,2,3,4 and 5. Then I also have a button named Print. I would like to give the user the opportunity to choose one of the option buttons and then press Print so the particular sheet/part of sheet named in the option button gets printed. Does anyone know VBA code for how to do this? Would appreciate it!! Andreas |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing solution
Thanks for all your help Ron, the last row code looks very promising. However
I do not understand what you mean here, I do not have any code yet just form option buttons inside a group box and then a button which says print. I would like the user to be able to choose between 5 different print alternatives by using the option buttons and after they've choosen an alternative being abl to push the print button and then it prints. I know how to do a macro and assign it directly to a button for printing but that reduces the flexibility in what to print too much. Any ideas? Thanks again "Ron de Bruin" wrote: Do you use Forms Option buttons ? In the properties set a linked cell Check the value of the cell in your code -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Andreas" wrote in message ... I have group box with five option buttons, let's say they are called 1,2,3,4 and 5. Then I also have a button named Print. I would like to give the user the opportunity to choose one of the option buttons and then press Print so the particular sheet/part of sheet named in the option button gets printed. Does anyone know VBA code for how to do this? Would appreciate it!! Andreas |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Printing solution
I add a few Option buttons from the Form toolbar on my worksheet (Sheet1)
My sheet are named Sheet1, Sheet2, ........., sheet5 If you right click on one of the option buttons choose format control set a linked cell, for example A1. The other option buttons have the same linked cell now. Click on them and you see the value change in A1 Now add a button from the forms button on your worksheet And assign this macro Sub test() Sheets("Sheet" & Sheets("Sheet1").Range("A1").Value).PrintOut preview:=True End Sub Delete preview:=True When it is working correct -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Andreas" wrote in message ... Thanks for all your help Ron, the last row code looks very promising. However I do not understand what you mean here, I do not have any code yet just form option buttons inside a group box and then a button which says print. I would like the user to be able to choose between 5 different print alternatives by using the option buttons and after they've choosen an alternative being abl to push the print button and then it prints. I know how to do a macro and assign it directly to a button for printing but that reduces the flexibility in what to print too much. Any ideas? Thanks again "Ron de Bruin" wrote: Do you use Forms Option buttons ? In the properties set a linked cell Check the value of the cell in your code -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Andreas" wrote in message ... I have group box with five option buttons, let's say they are called 1,2,3,4 and 5. Then I also have a button named Print. I would like to give the user the opportunity to choose one of the option buttons and then press Print so the particular sheet/part of sheet named in the option button gets printed. Does anyone know VBA code for how to do this? Would appreciate it!! Andreas |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Looking for a solution | Excel Worksheet Functions | |||
Looking for solution on Printing multiple sheets | Excel Programming | |||
Is There A Solution.......? | Excel Programming | |||
There must be some solution | Excel Programming | |||
Best Fit Solution | Excel Programming |