Results 1 to 5 of 5

How to make 2 macros work

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-11-2012
    Location
    minot, north dakota
    MS-Off Ver
    Excel 2010
    Posts
    127

    How to make 2 macros work

    Below I have pasted the 2 macros that i am trying to use. When I added the second macro which is the same as the first one but it is for a different cell erros pop up when i try changing the cell for the second macro. How do i correct this so that the second macro works?
    I am sure it is in the beginning of the notation for the second macro.




    Private Sub worksheet_change(ByVal target As Range)
    If Not Intersect(target, Range("D55")) Is Nothing Then
    Rows("56:65").EntireRow.Hidden = False
    Select Case target
    Case 0
    Rows("56:65").EntireRow.Hidden = True
    Case 1
    Rows("58:65").EntireRow.Hidden = True
    Case 2
    Rows("60:65").EntireRow.Hidden = True
    Case 3
    Rows("62:65").EntireRow.Hidden = True
    Case 4
    Rows("64:65").EntireRow.Hidden = True
    Case 5
    Rows("56:65").EntireRow.Hidden = False
    End Select
    End If
    End Sub

    Private Sub worksheet_change(ByVal target As Range)
    If Not Intersect(target, Range("H78")) Is Nothing Then
    Rows("80:112").EntireRow.Hidden = False
    Select Case target
    Case 0
    Rows("80:112").EntireRow.Hidden = True
    Case 1
    Rows("91:112").EntireRow.Hidden = True
    Case 2
    Rows("103:112").EntireRow.Hidden = True
    Case 3
    Rows("80:112").EntireRow.Hidden = False
    End Select
    End If
    End Sub
    Last edited by aaron061883; 01-05-2013 at 10:17 PM.

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