+ Reply to Thread
Results 1 to 3 of 3

Option Button to Hide Rows

  1. #1
    Registered User
    Join Date
    11-30-2012
    Location
    North Carolina
    MS-Off Ver
    Office 365
    Posts
    60

    Option Button to Hide Rows

    I have a series of five option buttons, in a group, in a worksheet. These are form objects, not active x. The value for the selected cell returns a value of 1 to 5 depending on user selection. The cell link with that value is on the same sheet (cell XFD1). if the user selects option button 11 or option button 12 (the first and second buttons), i want Rows 31 and 32 to be visible. The following code, assigned to the first option button, makes that happen. i have a comparable sub for Option Button 12 that also works will also make the rows visible, as desired.

    Please Login or Register  to view this content.

    I am trying to anticipate a situation where the user wrongly selects either of the first two options (displaying the two rows), then corrects the error by then selecting button 3, 4 or 5. When this occurs, i need rows 31:32 to be hidden.

    I have tried similar code for the third through fifth option buttons with the above sub, substituting
    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    ; neither approach works.

    Any suggestions would be appreciated.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,613

    Re: Option Button to Hide Rows

    Assign this same macro to all five option buttons. It hides all the relevant rows (31 to 40 in this example). Then it unhides specific rows depending on which option button was selected (the value in XFD1).

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    11-30-2012
    Location
    North Carolina
    MS-Off Ver
    Office 365
    Posts
    60

    Re: Option Button to Hide Rows

    That did the trick. Appreciate your solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hide option buttons based on other option button
    By monfos in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2016, 05:16 PM
  2. Option Button driven Macro to hide & unhide rows
    By SpencerRichman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2016, 05:24 PM
  3. [SOLVED] Macro to hide option button
    By TomBP in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2013, 11:34 AM
  4. Hide a picture button placed in all sheets using a option button (form control)
    By lagaranch in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-26-2012, 10:33 AM
  5. Userform Option Button to Show/Hide Another Option Button on same Userform
    By R_S_6 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-26-2010, 09:44 AM
  6. Option button to hide rows
    By Draco876 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2009, 08:38 AM
  7. option button to hide rows, with password
    By RRP333 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2005, 06:07 PM

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