In excel, I have 4 sets of properties that have rent data going horizontally, with the corresponding month of the rent data going horizontally at the top. The properties are listed going down vertically.
June,'15 July,'15
Set 1
prop 1 $2,588.00 $2,588.00
prop 2 $1,835.00 $1,829.00
Set 2
prop 3 $2,647.00 $2,707.00
prop 4 $2,501.00 $2,526.00
I want to create a VBA code with for a single graph that chooses the data from either property Set 1 or Set 2 to add to the graph. This is dependent on another cell (drop-down) changing in Excel:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will cause an alert when they are changed.
Set KeyCells = Range("D5")
If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
'This is where I would place the graph code
End If
End Sub
What would be the code to achieve such a task - building a dynamically changing graph?