Consulting

Results 1 to 8 of 8

Thread: 2 Vba Routines - stop working

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    May 2018
    Posts
    9
    Location

    2 Vba Routines - stop working

    I have 2 VBA routines. 1 is assigned to a button to clear cells the user has placed values in at the sheet level. The 2nd is to copy cells to other cells based on a drop down menus selection is in a macro.

    I am having the following issues:
    1. After the 1st time the clear cells button is clicked, the cells stop copying (macro1)



    Private Sub Worksheet_Change(ByVal Target As Range)
    
    
      Dim cell As Range
      
    
    
    '   Check to see if cell G3 updated
      If Target.Address = Range("G3").Address Then
           If Target.Value = "YES" Then
             Application.EnableEvents = False
             Range("E9:E12").Value = Range("J3:J6").Value
             Application.EnableEvents = True
      Else
      If Target.Address = Range("G3").Address Then
           If Target.Value = "NO" Then
             Application.EnableEvents = False
             Range("E9:E12").ClearContents
             Application.EnableEvents = True
          End If
         End If
        End If
      End If
            
    End Sub
    Sub Clearselected()
    Range("e3").ClearContents
    Range("e9", "e12").ClearContents
    Range("H9", "H12").ClearContents
    Range("i3", "i6").ClearContents
    Range("K9", "K12").ClearContents
    End Sub
    Last edited by SamT; 05-06-2018 at 01:56 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •