Hi all,
As above, there are only two type of line and condition to consider here.
When condition 1 is met, the line is solid and condition 2, the line is dash.
Want to create a vba which link to excel cell when the condition are met, the line change itself.
There is Private Sub Worksheet_Change(ByVal Target As Range) in my file. No sure if this is the place to put the macro. Just let you know.
Here is the two macro I get from the record macro:
Appreciated any help given.![]()
' ' Macro1 Macro ' ' ActiveSheet.ChartObjects("Chart 8").Activate ActiveChart.SeriesCollection(12).Select With Selection.Format.Line .Visible = msoTrue .DashStyle = msoLineSysDash < link to excel cell. probably need to change to something like Range("A100").Value. End With ActiveCell.Offset(3, 0).Range("A1").Select End Sub Sub Macro2() ' ' Macro2 Macro ' ' ActiveSheet.ChartObjects("Chart 8").Activate ActiveChart.SeriesCollection(12).Select With Selection.Format.Line .Visible = msoTrue .DashStyle = msoLineSolid End With ActiveCell.Offset(-2, 0).Range("A1").Select End Sub
Bookmarks