Option Button for Macro

qwertysz

New Member
Joined
Jun 15, 2012
Messages
11
Hello,

the uses of Option Button would be perfect for my macro but...

How to put Option Buttons on a Box like InputBox or MsgBox?

I don't like to put them o a spreadsheet, is it possible?
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,701
Office Version
  1. 2016
Platform
  1. Windows
Look in the VBA screen and select the Insert Menu and UserForm you can then use the design tools to build up a form with these controls.
 

qwertysz

New Member
Joined
Jun 15, 2012
Messages
11
Is the userform invisible?

I mean, it must appear only when I must choose one option but then disappear.. is it possible with the userform?
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,919

ADVERTISEMENT

Where do you want the option button? On a userform?
"it must appear only when I must choose one option but then disappear"

I'm not sure how you want the user interface to function.
 

qwertysz

New Member
Joined
Jun 15, 2012
Messages
11
Hope I can let understand me...

I've got a macro that creates a new sheet. In that new sheet, in A1 I like to put a number of 20 digit (only 3 different types) but won't ask ever and ever the user to enter it with inputbox.

I remember about the option button, where I can put this numbers and let the user choose what he need.

How does I want the macro works:
- Start the Macro
- Creates sheet
- Let userform be visible
- Choose which number I need and confirm it with button on userform
- Let userform be invisible
- and Go on..

I don't know well userform so I don't know how it works...
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,919

ADVERTISEMENT

A userform could do that.
 

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,701
Office Version
  1. 2016
Platform
  1. Windows
Look at the Option Group in the userfrom and change the caption to the numbers you want and add several then name each option something like optFirst or optSecond then you would add a command button and the code would go behind the command button using either an IF statement or a Select Case statement.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,318
Messages
5,600,921
Members
414,416
Latest member
Nobu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top