Results 1 to 3 of 3

Macro to Hide/Unhide Multiple Rows Based on Cell Value

Threaded View

mbp727 Macro to Hide/Unhide Multiple... 05-14-2013, 11:07 AM
ragavan.sridar1 Re: Macro to Hide/Unhide... 05-14-2013, 12:47 PM
mbp727 Re: Macro to Hide/Unhide... 05-17-2013, 11:12 AM
  1. #1
    Registered User
    Join Date
    05-10-2013
    Location
    Florida, USA
    MS-Off Ver
    Excel 2013
    Posts
    7

    Macro to Hide/Unhide Multiple Rows Based on Cell Value

    I have a sheet with regions listed and a selector to choose whether or not to "enable" the region. If "yes" is selected, the value 1 is returned, if "no" is selected the value 0 is returned.

    I want to write the macro like the one below, but instead of listing the rows as ranges I need to refer to multiple, specific rows. Ex. 15, 18, 23.

    Private Sub Worksheet_Calculate()
    If Range("D7").Value = 0 Then
    Rows("15:25").Hidden = False                           Want to list specific rows here, not a range of rows
    End If
    
    If Range("D7").Value = 0 Then
    Rows("26:35").Hidden = True
    End If
    Thanks
    Last edited by Leith Ross; 05-14-2013 at 12:36 PM. Reason: Added Code Tags

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