Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Automatically fill in options on a form

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Where the wild roses grow
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,

    I have a togglebutton and a combobox (which contains Yes, No and Maybe in it) on a userform I've designed. If I push the togglebutton I want Yes to be automatically displayed in the combobox. What line of code will I need to do this?

    If it helps, the userform is called Userform2, the togglebutton is Togglebutton1 and the Combobox is called Combobox2

    Thanks for any help

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    Try something like:

    Private Sub ToggleButton1_Click()
    Dim strReply As String
    Select Case ToggleButton1.Value
    Case True
    strReply = "Yes"
    Case False
    strReply = "No"
    End Select
    ComboBox1 = strReply
    End Sub

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Where the wild roses grow
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Dave, that works great

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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