Consulting

Results 1 to 3 of 3

Thread: Set Focus To A Particular Cells with OptionButton

  1. #1
    VBAX Regular
    Joined
    Apr 2018
    Posts
    50
    Location

    Set Focus To A Particular Cells with OptionButton

    I have 5 sets of yes and no optionbuttons (active x controls). "No" is set for default.
    I want to achieve on when the OptionButton "Yes" is clicked it would automatically take take focus on that cell.

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Private Sub OptionButton1_Click()
    If OptionButton1 = "Yes" Then 
       Range("A1").Select
    Else
       Range("B1").Select 'Default Range
    End If
    End Sub
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Regular
    Joined
    Apr 2018
    Posts
    50
    Location
    Quote Originally Posted by SamT View Post
    Private Sub OptionButton1_Click()
    If OptionButton1 = "Yes" Then 
       Range("A1").Select
    Else
       Range("B1").Select 'Default Range
    End If
    End Sub
    works like a charm!!

Posting Permissions

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