Macro to change data in a sheet

G

Guest

I have two sheets in my workbook. One is the main sheet with radio buttons
that I am assigning macros to and the other sheet is the data sheet. What I
would like to do is to whenever I check the radio button data in specific
cells on a second sheet changes without actually showing that sheet. Every
single time the radio button is selected data in a second sheet changes and
the sheet appears with the changed data. I want the data to change but the
sheet should remain hidden. Is there a way to do this.

Thanks
 
C

Casey

Diane,
I'm not an expert and your post was a little vague, but this might give
you a starting place.

Option Explicit

Private Sub OptionButton1_Click()

Dim wks As Worksheet
Set wks = Worksheets("Data") '<=====Change name as needed
If OptionButton1.Value = True Then
wks.Range("A1") = 100
End If
End Sub

Private Sub OptionButton2_Click()
Dim wks As Worksheet
Set wks = Worksheets("Data") '<=====Change name as needed
If OptionButton2.Value = True Then
wks.Range("A1") = 50
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top