Hi everyone
I have this new piece of code I wish to add to a tab called the PV Calculator.
Sub worksheet_selectionChange(ByVal target As Range)
If Range("GB12").Value = 1 Then Rows(9).EntireRow.Hidden = True
If Range("GB12").Value = 0 Then Rows(9).EntireRow.Hidden = False
End Sub
However, when I go to do View Code there is a macro already there that looks like this:
Private Sub worksheet_selectionChange(ByVal target As Excel.Range)
With target
If .Count > 1 Then Exit Sub
If .Address(False, False) = "C17" Then _
Range("C18").ClearContents
If .Address(False, False) = "17" Then _
Range("C7").ClearContents
End With
End Sub
If I just paste one under the other then the above doesn't work, nor does the top one.
I'm not very clever at this so I need assistance. How do I associate these separately with the tab called PV calculator.
Secondly I need the top one to update the moment the person enters the tab (not waiting until somethign is clicked on the screen).
Any help would be much appreciated.
I have this new piece of code I wish to add to a tab called the PV Calculator.
Sub worksheet_selectionChange(ByVal target As Range)
If Range("GB12").Value = 1 Then Rows(9).EntireRow.Hidden = True
If Range("GB12").Value = 0 Then Rows(9).EntireRow.Hidden = False
End Sub
However, when I go to do View Code there is a macro already there that looks like this:
Private Sub worksheet_selectionChange(ByVal target As Excel.Range)
With target
If .Count > 1 Then Exit Sub
If .Address(False, False) = "C17" Then _
Range("C18").ClearContents
If .Address(False, False) = "17" Then _
Range("C7").ClearContents
End With
End Sub
If I just paste one under the other then the above doesn't work, nor does the top one.
I'm not very clever at this so I need assistance. How do I associate these separately with the tab called PV calculator.
Secondly I need the top one to update the moment the person enters the tab (not waiting until somethign is clicked on the screen).
Any help would be much appreciated.