Results 1 to 11 of 11

Making rows invisible with VBA

Threaded View

  1. #1
    Registered User
    Join Date
    07-25-2008
    Location
    Irvine
    Posts
    7

    Making rows invisible with VBA

    Hi, I have a cell range from A18 to A49, and I want a macro to hide the rows that have zeros in them. For example, if the value on A24 is zero, row 24 would be hidden. But if the value on A24 changes to a number later, row 24 would show up again.

    Now I guess you can already tell I am a beginner at VBA. I thought of a macro like this:

    If ActiveSheet.Range("A18").Value = 0 Then
    ActiveSheet.Rows("18:18").Hidden = True
    Else: ActiveSheet.Rows("18:18").Hidden = False
    End If
    But repeating those lines from A18 to A49 seems pretty tedious. Is there a faster way to do this?
    Last edited by teylyn; 05-08-2010 at 02:13 AM.

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