+ Reply to Thread
Results 1 to 3 of 3

Hide/ unhide rows in spreadsheet with macro

  1. #1
    Registered User
    Join Date
    03-18-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Hide/ unhide rows in spreadsheet with macro

    I have been using the macro below to hide rows in a spreadsheet when the result is 0. Is there a way to have the macro unhide cells in column F that have changed from a 0 to a number at the same time?

    Sub hide_rows()
    Dim i As Long, lrow As Long

    Application.ScreenUpdating = False

    With Worksheets("Sheet1")
    lrow = .Range("f" & .Rows.Count).End(xlUp).Row
    For i = 11 To lrow
    If .Range("f" & i).Value = "0" Then .Rows(i).Hidden = True
    Next i
    End With


    Application.ScreenUpdating = True

    'uncomment following line if you want to return to automatic calculation
    'Application.Calculation = xlCalculationAutomatic

    End Sub

    Thanks for your help!!
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Hide/ unhide rows in spreadsheet with macro

    Try this....

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    03-18-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Hide/ unhide rows in spreadsheet with macro

    Thanks that works great!!

+ 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