C
CB
Hello,
I’m trying to determine how to clear the option buttons on my worksheet for
the instance when the user first goes to the given page. I figure that if
they are blank, the user will realize that nothing has been selected so they
have to select something. I read the post “Set OptionBox Value via VBAâ€
posted earlier today and tried the using Chip’s suggestions in the
Workbook_Activate() procedure (thinking these would be “default†valuesâ€) but
kept getting various types of errors. I don’t even remember what anymore –
my head is spinning….
A little more info for you…
My workbook has two sheets, “Pre-Service†and “Post-Service.†The second
sheet contains six option buttons (added using the Control Toolbox) set up as
three groups of two buttons. Each group has a YES button and a NO button. I
haven’t linked the buttons to a particular cell via the properties, but I do
have code that will put a YES or NO in a given cell depending on which button
in the group was clicked. I’ve included the code below to help clarify what I
mean. I’m not sure it’s that efficient but it works.
Private Sub DesiccantYes_Click()
Worksheets("Post-Service").Range("N4") = "Yes"
End Sub
Private Sub DessicantNo_Click()
Worksheets("Post-Service").Range("N4") = "No"
End Sub
Private Sub OringYes_Click()
Worksheets("Post-Service").Range("N5") = "Yes"
End Sub
Private Sub OringNo_Click()
Worksheets("Post-Service").Range("N5") = "No"
End Sub
Private Sub TransducerYes_Click()
Worksheets("Post-Service").Range("N6") = "Yes"
End Sub
Private Sub TransducerNo_Click()
Worksheets("Post-Service").Range("N6") = "No"
End Sub
Thanks again!
Chris
I’m trying to determine how to clear the option buttons on my worksheet for
the instance when the user first goes to the given page. I figure that if
they are blank, the user will realize that nothing has been selected so they
have to select something. I read the post “Set OptionBox Value via VBAâ€
posted earlier today and tried the using Chip’s suggestions in the
Workbook_Activate() procedure (thinking these would be “default†valuesâ€) but
kept getting various types of errors. I don’t even remember what anymore –
my head is spinning….
A little more info for you…
My workbook has two sheets, “Pre-Service†and “Post-Service.†The second
sheet contains six option buttons (added using the Control Toolbox) set up as
three groups of two buttons. Each group has a YES button and a NO button. I
haven’t linked the buttons to a particular cell via the properties, but I do
have code that will put a YES or NO in a given cell depending on which button
in the group was clicked. I’ve included the code below to help clarify what I
mean. I’m not sure it’s that efficient but it works.
Private Sub DesiccantYes_Click()
Worksheets("Post-Service").Range("N4") = "Yes"
End Sub
Private Sub DessicantNo_Click()
Worksheets("Post-Service").Range("N4") = "No"
End Sub
Private Sub OringYes_Click()
Worksheets("Post-Service").Range("N5") = "Yes"
End Sub
Private Sub OringNo_Click()
Worksheets("Post-Service").Range("N5") = "No"
End Sub
Private Sub TransducerYes_Click()
Worksheets("Post-Service").Range("N6") = "Yes"
End Sub
Private Sub TransducerNo_Click()
Worksheets("Post-Service").Range("N6") = "No"
End Sub
Thanks again!
Chris