Consulting

Results 1 to 12 of 12

Thread: VBA code

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Dec 2022
    Posts
    1
    Location

    VBA code

    This code works:
    Private Sub Worksheet_Change(ByVal Target As Range) 
    Dim WS As Worksheet 
    Dim RNG As Range 
      Set RNG = Range("A28:A31") 
      Set WS = Sheets("Sheet2") 
        WS.Range("A28:A31").EntireRow.Hidden = True 
    End Sub 
    but I need to replace it with:
    Private Sub Worksheet_Change(ByVal Target As Range) 
    Dim WS As Worksheet 
    Dim RNG As Range 
      Set RNG = Range("A28:A31") 
      Set WS = Sheets("Sheet2") 
        WS.RNG.EntireRow.Hidden = True 
    End Sub 
    And this doesnt work.
    Any help ?
    Thank you
    Last edited by Aussiebear; 12-08-2022 at 12:32 PM. Reason: Added code tags to supplied code

Posting Permissions

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