Results 1 to 4 of 4

Macro does not run automatically

Threaded View

  1. #1
    Registered User
    Join Date
    10-27-2010
    Location
    Fullerton, CA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Macro does not run automatically

    I have a workbook that has 11 tabs. 1 is a summary page, and the other 10 are the variable sheets. The 10 variable sheets have check boxes for about 30 different values per sheet to choose from. The summary sheet shows all (roughly 300 items) of the data from all 10 of the variable sheets. Column E in the summary sheet shows an "x" when the box is unchecked in the variable sheets, and shows "Have" when it is checked. I wanted all the rows where the value in the E column was "Have" to automatically hide the entire row. I inserted the following as a sheet module:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim cell As Range
    Application.ScreenUpdating = False
    For Each cell In Range("E:E")
    If cell.Value = Have Then
    cell.EntireRow.Hidden = True
    ElseIf cell.Value = x Then
    cell.EntireRow.Hidden = False
    End If
    Next
    Application.ScreenUpdating = True
    End Sub
    That worked perfectly. But after the initial hiding of the rows with the Value of "Have" in the E column, i can check boxes in the 10 variable sheets, the summary page with the macro will still update from "x" to "Have", but in order to have it auto-hide, i have to make any cell active, then hit enter and the macro will work. I am an extreme VBA noob. Is there anything that seems wrong with what I've done? Thank you for the help!
    Last edited by Paul; 10-27-2010 at 11:38 PM. Reason: Added code tags for user. Please read the forum rules.

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