+ Reply to Thread
Results 1 to 4 of 4

A value based on OptionButton selection

Hybrid View

  1. #1
    Sony
    Guest

    A value based on OptionButton selection

    I have a Userform that has several fields that are then populated on various
    cells. What I have a question about is I have 3 optionbuttons that I want to
    tie to a specifc cell on another sheet.

    Example, open Userform from Sheet 2, OptionButton1 is selected (True) then I
    want "Denied" placed in a specific cell on Sheet 1.

    My userforms work correctly with the exception of placing my comment when
    the optionbutton is true.

    Thank you in advance for your help.
    --
    Sony

  2. #2
    Tom Ogilvy
    Guest

    RE: A value based on OptionButton selection

    in the control source property of the option button put in

    sheet1!B9

    as an example.

    --
    Regards,
    Tom Ogilvy


    "Sony" wrote:

    > I have a Userform that has several fields that are then populated on various
    > cells. What I have a question about is I have 3 optionbuttons that I want to
    > tie to a specifc cell on another sheet.
    >
    > Example, open Userform from Sheet 2, OptionButton1 is selected (True) then I
    > want "Denied" placed in a specific cell on Sheet 1.
    >
    > My userforms work correctly with the exception of placing my comment when
    > the optionbutton is true.
    >
    > Thank you in advance for your help.
    > --
    > Sony


  3. #3
    Sony
    Guest

    RE: A value based on OptionButton selection

    I want to do this based on other information, I will provide a sample of my
    code that is tied to a command button. My UserForm contains this command
    button, as well as a Textbox & an OptionButton.

    Private Sub CommandButton1_Click()
    Dim Msg, Style, Title, Response
    Msg = "Request Denied"
    Style = vbYesNo + vbCritical + vbSubReq
    Title = "Request Denied"
    Response = MsgBox(Msg, Style, Title)
    If Response = vbYes Then
    ActiveWorkbook.SendMail Array("xxxxxx@email.com"), ("Request Denied")
    MsgBox ("The Denied Notification has been sent")
    Sheets("Request").Range("f7").Value = TextBox1

    If OptionButton1.Value = "True" Then
    Set C = Range("h16")
    C.Sheet ("Request")
    C.Value = "Denied"

    Unload Me
    End If
    Else
    MsgBox "Send operation aborted."
    Unload Me
    End If
    End Sub




    --
    Sony


    "Tom Ogilvy" wrote:

    > in the control source property of the option button put in
    >
    > sheet1!B9
    >
    > as an example.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Sony" wrote:
    >
    > > I have a Userform that has several fields that are then populated on various
    > > cells. What I have a question about is I have 3 optionbuttons that I want to
    > > tie to a specifc cell on another sheet.
    > >
    > > Example, open Userform from Sheet 2, OptionButton1 is selected (True) then I
    > > want "Denied" placed in a specific cell on Sheet 1.
    > >
    > > My userforms work correctly with the exception of placing my comment when
    > > the optionbutton is true.
    > >
    > > Thank you in advance for your help.
    > > --
    > > Sony


  4. #4
    Tom Ogilvy
    Guest

    RE: A value based on OptionButton selection

    the concept is the same - qualify your range reference. See example below.

    Set C = WorkSheets("Somesheetname").Range("h16")


    --
    Regards,
    Tom Ogilvy

    "Sony" wrote:

    > I want to do this based on other information, I will provide a sample of my
    > code that is tied to a command button. My UserForm contains this command
    > button, as well as a Textbox & an OptionButton.
    >
    > Private Sub CommandButton1_Click()
    > Dim Msg, Style, Title, Response
    > Msg = "Request Denied"
    > Style = vbYesNo + vbCritical + vbSubReq
    > Title = "Request Denied"
    > Response = MsgBox(Msg, Style, Title)
    > If Response = vbYes Then
    > ActiveWorkbook.SendMail Array("xxxxxx@email.com"), ("Request Denied")
    > MsgBox ("The Denied Notification has been sent")
    > Sheets("Request").Range("f7").Value = TextBox1
    >
    > If OptionButton1.Value = "True" Then
    > Set C = Range("h16")
    > C.Sheet ("Request")
    > C.Value = "Denied"
    >
    > Unload Me
    > End If
    > Else
    > MsgBox "Send operation aborted."
    > Unload Me
    > End If
    > End Sub
    >
    >
    >
    >
    > --
    > Sony
    >
    >
    > "Tom Ogilvy" wrote:
    >
    > > in the control source property of the option button put in
    > >
    > > sheet1!B9
    > >
    > > as an example.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "Sony" wrote:
    > >
    > > > I have a Userform that has several fields that are then populated on various
    > > > cells. What I have a question about is I have 3 optionbuttons that I want to
    > > > tie to a specifc cell on another sheet.
    > > >
    > > > Example, open Userform from Sheet 2, OptionButton1 is selected (True) then I
    > > > want "Denied" placed in a specific cell on Sheet 1.
    > > >
    > > > My userforms work correctly with the exception of placing my comment when
    > > > the optionbutton is true.
    > > >
    > > > Thank you in advance for your help.
    > > > --
    > > > Sony


+ 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.6.0 RC 1