Option button cell color help please

PARSONSAA

New Member
Joined
Jul 10, 2008
Messages
22
With help from this forum I have been able to come up with a macro to help update spreadsheets. I am now trying to use option buttons to have it color the background of the 8 cells in questions below is what I have come up with so far. I was thinking of a if then statement between the options but have been struggling. Any help would be great.

Code:
Private Sub ComboCentrifuge_Click()
    Me.TextFeatures.Value = Sheets("Centrifuge").Range("B" & ComboCentrifuge.ListIndex + 17)
    Me.ComboBoxRig.Value = Sheets("Centrifuge").Range("C" & ComboCentrifuge.ListIndex + 17)
    Me.TextRigNum.Value = Sheets("Centrifuge").Range("E" & ComboCentrifuge.ListIndex + 17)
    Me.ComboBoxOper.Value = Sheets("Centrifuge").Range("F" & ComboCentrifuge.ListIndex + 17)
    Me.TextBoxArea.Value = Sheets("Centrifuge").Range("G" & ComboCentrifuge.ListIndex + 17)
    Me.TextBoxRR.Value = Sheets("Centrifuge").Range("H" & ComboCentrifuge.ListIndex + 17)
    Me.TextBoxStatus.Value = Sheets("Centrifuge").Range("I" & ComboCentrifuge.ListIndex + 17)
End Sub
Private Sub CommandClose_Click()
    Worksheets("Centrifuge").Range("B" & ComboCentrifuge.ListIndex + 17) = TextFeatures.Value
    Worksheets("Centrifuge").Range("C" & ComboCentrifuge.ListIndex + 17) = ComboBoxRig.Value
    Worksheets("Centrifuge").Range("E" & ComboCentrifuge.ListIndex + 17) = TextRigNum.Value
    Worksheets("Centrifuge").Range("F" & ComboCentrifuge.ListIndex + 17) = ComboBoxOper.Value
    Worksheets("Centrifuge").Range("G" & ComboCentrifuge.ListIndex + 17) = TextBoxArea.Value
    Worksheets("Centrifuge").Range("H" & ComboCentrifuge.ListIndex + 17) = TextBoxRR.Value
    Worksheets("Centrifuge").Range("I" & ComboCentrifuge.ListIndex + 17) = TextBoxStatus.Value
    Unload Me
End Sub
 
Private Sub OptionButtonBonneyville_Click()
End Sub
Private Sub OptionButtonEstevan_Click()
End Sub

Private Sub OptionButtonFtNelson_Click()
End Sub
Private Sub OptionButtonGP_Click()
End Sub
Private Sub OptionButtonLeduc_Click()
End Sub
 
Private Sub UserForm_Initialize()
    For Each c In Worksheets("Centrifuge").Range("A17", Range("A65000").End(xlUp))
        Me.ComboCentrifuge.AddItem c.Value
    Next c
End Sub
 
Last edited by a moderator:

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
googled it but nothing like i am looking for
? idea :) as you can see i am trying to get out of the office early today... and you can also see this is not what i do but was never the less tossed on my lap lol I do like a good challange tho :)
 
Upvote 0

Forum statistics

Threads
1,215,506
Messages
6,125,193
Members
449,213
Latest member
Kirbito

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top