• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

VBA in MS Office - how do I get input from a dialog w/ radio buttons?

JDub02

Diamond Member
I have all of about 2 days experience with VB. I'm trying to create a macro for my admin at work to automatically fill in an e-mail with standard text that she uses when e-mailing out some of our paperwork.

I have it working right now with prompts to fill in the text that changes using the InputBox() function. A few of those I would like to replace with a dialog box with radio buttons, because they're always going to be one of the same 4 choices.

I've figured out how to create a User Form and get it to appear using UserForm1.Show .. but I don't know how to get the choice from it.

Any VB pro's around?
 
radio buttons return true / false depending on whether they're clicked, so you can use a series of if then statements to choose your text

if UserForm1.RadioButton1 then
...
else if UserForm1.RadioButton2 then

etc...
 
Thanks.

I'm having the problem now of the OK button not responding. I guess I don't have any code for it to close the window. I clicked on the button and it sends me to a function cmdOK_Click() that's empty.

How do I get the dialog to close?
 
I think I have it. I found what looks to be a decent tutorial for doing something similar in Excel. I'll see how it works.
 
Back
Top