Private Sub Worksheet_activate() Dim wS As Worksheet, LastRow As Long Set wS = ThisWorkbook.Worksheets("Sheet1") 'Here we look in Column F LastRow = wS.Cells(wS.Rows.Count, "F").End(xlUp).Row 'LastRow = 5 ' MsgBox (LastRow) Dim cht As Chart Dim ser As Series Dim iSrs As Long, nSrs As Long Set cht = ActiveSheet.ChartObjects("Chart 1").Chart cht.SetSourceData Source:=Range("F1:" & "S" & LastRow) End Sub
Wednesday, 5 January 2022
Chart range auto refresh in excel vba
Labels:
Excel,
Excel Macros
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment