Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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
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
Looking for a solution CA Linda Excel Worksheet Functions 1 July 7th 09 05:31 PM
Looking for solution on Printing multiple sheets Little Penny Excel Programming 1 August 22nd 06 04:57 AM
Is There A Solution.......? Thyagaraj Excel Programming 3 August 8th 06 03:59 PM
There must be some solution Peter Ostermann Excel Programming 1 May 11th 05 02:00 PM
Best Fit Solution Tom Ogilvy Excel Programming 0 August 26th 04 05:34 PM


All times are GMT +1. The time now is 10:34 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"