0

My current sub uses the lastrow which includes the total in my data set, I want to use one above the lastrow so the chart doesn't include the "Total Row" but getting errors.

Ive tried to do range("A6",Range(LastRow)

Ive also tried Range("A6", Range("A6").End(xlDown)-1 )

Sub NewChart()
    Dim LastRow As Long
    LastRow = Worksheets("Dashboard").Cells(Rows.Count, "A").End(xlUp).Row - 1

    Worksheets("Dashboard").Select
    Union( _
    Range("A6", Range("A6").End(xlDown)), _
    Range("E6", Range("E6").End(xlDown))).Select
    Charts.Add 
End Sub
Robert Todar
  • 2,085
  • 2
  • 11
  • 31

0 Answers0