Results 1 to 4 of 4

Thread: VBA Code will not update as target cell is updated using a formula

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    VBA Code will not update as target cell is updated using a formula

    Hi All,

    I am new to VBA and know virtually nothing. I have the following code that hides rows based on the cell value in A99. It works fine, however, when the value in A99 changes, the vba code does not run unless i click on cell A99.

    Is there a way to adapt the code to update anytime the formula in cell A99 changes the value.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$A$99" Then
    Rows("102:119").Hidden = False
    If Target.Value > 0 And Target.Value < 19 Then
    Rows(Target.Value + 101 & ":119").Hidden = True
    End If
    End If
    End Sub
    Thanks in advance.

    NS
    Last edited by Paul_Hossler; 06-05-2020 at 05:45 PM. Reason: Added CODE tags

Posting Permissions

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