+ Reply to Thread
Results 1 to 3 of 3

Coding for Option Buttons

Hybrid View

  1. #1
    Registered User
    Join Date
    09-14-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2007
    Posts
    45

    Coding for Option Buttons

    I have three option buttons in a group box.

    The code I tried (below) doesn't work, and I'd appreciate some advice, please.

    Private Sub optListing_Click()
    'If Cells(12, 1).Value = "True" Then
        Cells(21, 2).Value = Cells(14, 3).Value
        ...
    End Sub
    Private Sub optSell_Click()
    'ElseIf Cells(13, 1).Value = "True" Then
        Cells(26, 2).Value = Cells(14, 3).Value
        ...
        End Sub
    Private Sub optBoth_Click()
        Cells(21, 2).Value = Cells(14, 3).Value
        Cells(26, 2).Value = Cells(14, 3).Value
        ...
    End If
    End Sub
    Last edited by Jazzzbo; 04-22-2013 at 05:44 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,950

    Re: Coding for Option Buttons

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code in [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    Ben Van Johnson

  3. #3
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Coding for Option Buttons

    did you define your sheets? can you post the whole macro?

+ 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