Results 1 to 3 of 3

VB code for showing/hiding the following 20 rows?

Threaded View

  1. #1
    Registered User
    Join Date
    03-30-2012
    Location
    Tamworth, EN
    MS-Off Ver
    Excel 2007?
    Posts
    14

    VB code for showing/hiding the following 20 rows?

    I have buttons that show and hide specific sets of rows:

    Sub COLCHESTER_HIDE()
    '
    ' COLCHESTER_HIDE Macro
    '
    
    '
        Rows("255:274").Select
        Selection.EntireRow.Hidden = True
    End Sub
    Sub COLCHESTER_SHOW()
    '
    ' COLCHESTER_SHOW Macro
    '
    
    '
        Rows("254:275").Select
        Selection.EntireRow.Hidden = False
        Range("A255:B255").Select
    End Sub
    I have 60 locations to do this for!

    Is there any way I can just tell excel to hide/show the next 20 rows rather than having to record each macro individually?
    Last edited by arlu1201; 03-30-2012 at 10:04 AM. Reason: Code tags not quote 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