doppleganger
New Member
- Joined
- Mar 12, 2013
- Messages
- 5
The below macro allows users to select a cell from the named range "rngStructure" and produce a value in "valSelItem". This value I use to dynamically drive a dashboard.
I now need to expand this dashboard to include a 2nd variable (output) "valSelItem2" from a 2nd range "rngStructure2", however I'm not sure how to incorporate this 2nd requirement into my current macro.
The end result from a user perspective is selection of "rngStructure" narrows down the dataset, while the selection of another cell within "rngStructure2" allows that dataset to be further refined in the dashboard.
Any assistance would be appreciated
Cheers
I now need to expand this dashboard to include a 2nd variable (output) "valSelItem2" from a 2nd range "rngStructure2", however I'm not sure how to incorporate this 2nd requirement into my current macro.
The end result from a user perspective is selection of "rngStructure" narrows down the dataset, while the selection of another cell within "rngStructure2" allows that dataset to be further refined in the dashboard.
Any assistance would be appreciated
Cheers
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not _
(Application.Intersect(ActiveCell, Range("rngStructure").Cells) _
Is Nothing) Then _
Call UpdateAfterAction
End Sub
Sub UpdateAfterAction()
Dim topRow As Integer
topRow = Range("rngStructure").Cells(1, 1).Row
[valSelItem] = ActiveCell.Row() - topRow + 1
End Sub