+ Reply to Thread
Results 1 to 2 of 2

Macro to change data in a sheet

  1. #1
    Diana
    Guest

    Macro to change data in a sheet

    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

  2. #2
    Forum Contributor
    Join Date
    01-06-2004
    Location
    Carbondale CO
    Posts
    245
    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
    Casey

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1