+ Reply to Thread
Results 1 to 8 of 8

Thread: Add an alert message to a radio button in a group

  1. #1
    Registered User
    Join Date
    11-11-2011
    Location
    Phoenix
    MS-Off Ver
    Excel 2007/2010
    Posts
    4

    Question Add an alert message to a radio button in a group

    I have a self-assesment worksheet that has Yes/No radio buttons. What I want to do is make it so if they click the "No" radio button instead of "Yes" a message will pop up and tell them to explain how they are going to come into comliance. Any help would be greatly appreciated.

  2. #2
    Forum Guru pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2010
    Posts
    5,150

    Re: Add an alert message to a radio button in a group

    Hi Data2link

    Welcome to the forum

    try...
    Private Sub OptionButton1_Click()
    If OptionButton1.Value Then MsgBox "Help"
    End Sub
    regards pike

    If the solution helped please donate
    here to the RSPCA

    Sites worth visiting;

    J&R Solutions - royUK

    AJP Excel Information - Andy Pope

    Spreadsheet Toolbox

    VBA for smarties - snb

  3. #3
    Registered User
    Join Date
    11-11-2011
    Location
    Phoenix
    MS-Off Ver
    Excel 2007/2010
    Posts
    4

    Re: Add an alert message to a radio button in a group

    Quote Originally Posted by pike View Post
    Hi Data2link

    Welcome to the forum

    try...
    Private Sub OptionButton1_Click()
    If OptionButton1.Value Then MsgBox "Help"
    End Sub
    Ok thanks- I will try that...I put it as a macro and just asignd the macro to the "No" toggle button right? Or if not- where do I put that code?

    Thanks for the help - and thanks for the welcome!
    Last edited by Data2link; 11-14-2011 at 03:08 PM.

  4. #4
    Forum Guru pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2010
    Posts
    5,150

    Re: Add an alert message to a radio button in a group

    hi Data2link
    No new to quote back as its just clutter. can you post the workbook?
    regards pike

    If the solution helped please donate
    here to the RSPCA

    Sites worth visiting;

    J&R Solutions - royUK

    AJP Excel Information - Andy Pope

    Spreadsheet Toolbox

    VBA for smarties - snb

  5. #5
    Registered User
    Join Date
    11-11-2011
    Location
    Phoenix
    MS-Off Ver
    Excel 2007/2010
    Posts
    4

    Re: Add an alert message to a radio button in a group

    I wish I could post it but I can't- It's security related- I made a generic one though to show you what I'm looking for - I want a message to pop up if any of the NO buttons are clicked

    Thanks again
    Attached Files Attached Files
    Last edited by Data2link; 11-14-2011 at 05:09 PM.

  6. #6
    Forum Guru pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2010
    Posts
    5,150

    Re: Add an alert message to a radio button in a group

    OK Radio buttons always confusing - option button
    the assign maro will be like

    Sub OptionButton_No_()
    If Worksheets("Sheet1").Range("A2").Value = 2 Then MsgBox "Help"
    End Sub
    regards pike

    If the solution helped please donate
    here to the RSPCA

    Sites worth visiting;

    J&R Solutions - royUK

    AJP Excel Information - Andy Pope

    Spreadsheet Toolbox

    VBA for smarties - snb

  7. #7
    Registered User
    Join Date
    11-11-2011
    Location
    Phoenix
    MS-Off Ver
    Excel 2007/2010
    Posts
    4

    Re: Add an alert message to a radio button in a group

    Thanks for the code. For some reason when I add this macro, when I go in to assign it to the NO option button it's not there?

  8. #8
    Forum Guru pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2010
    Posts
    5,150

    Re: Add an alert message to a radio button in a group

    hmmm. it works for me
    see attachment

    Sub OptionButton_No_Two()
    If Worksheets("Sheet1").Range("A3").Value = 2 Then MsgBox "Help Two"
    Worksheets("Sheet1").Range("A3").Value = 1
    End Sub
    Sub OptionButton_No_One()
    If Worksheets("Sheet1").Range("A2").Value = 2 Then MsgBox "Help One"
    Worksheets("Sheet1").Range("A2").Value = 1
    End Sub
    Attached Files Attached Files
    regards pike

    If the solution helped please donate
    here to the RSPCA

    Sites worth visiting;

    J&R Solutions - royUK

    AJP Excel Information - Andy Pope

    Spreadsheet Toolbox

    VBA for smarties - snb

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0