R
rob nobel
Can someone please help me to modify this code (with thanks to Dave
Peterson!)?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim pvttable As PivotTable
If Intersect(Target, Me.Range("L26:L1525")) Is Nothing Then Exit Sub
Select Case UCase(Me.Cells(Target.Row, "F").Value)
Case Is = UCase(Me.Range("F16").Value)
Set pvttable = Sheet15.PivotTables("PivotTable1")
End Select
If pvttable Is Nothing Then Exit Sub
End Sub
I need ....
Set pvttable = Sheet15.PivotTables("PivotTable1") to depend on the following
2 criteria.
1.Case Is = UCase(Me.Range("F16").Value) ....(which is already there)
2. When the cell in the same row in column H is >0
If both those conditions are not true, I need it to ....
Set pvttable = Sheet16.PivotTables("PivotTable1") to depend on the
following 2 criteria.
1.Case Is = UCase(Me.Range("F16").Value) ....(which is already there)
2.When the cell in the same row in column I is >0
(Please note the different sheet and column names.)
Rob
Peterson!)?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim pvttable As PivotTable
If Intersect(Target, Me.Range("L26:L1525")) Is Nothing Then Exit Sub
Select Case UCase(Me.Cells(Target.Row, "F").Value)
Case Is = UCase(Me.Range("F16").Value)
Set pvttable = Sheet15.PivotTables("PivotTable1")
End Select
If pvttable Is Nothing Then Exit Sub
End Sub
I need ....
Set pvttable = Sheet15.PivotTables("PivotTable1") to depend on the following
2 criteria.
1.Case Is = UCase(Me.Range("F16").Value) ....(which is already there)
2. When the cell in the same row in column H is >0
If both those conditions are not true, I need it to ....
Set pvttable = Sheet16.PivotTables("PivotTable1") to depend on the
following 2 criteria.
1.Case Is = UCase(Me.Range("F16").Value) ....(which is already there)
2.When the cell in the same row in column I is >0
(Please note the different sheet and column names.)
Rob