I hope someone can help,
I have this macro that finds all data in columns A:D, creates a chart from that data, saves the chart as a .png image then deletes the chart.
It works perfectly when the are no blank rows, but as soon as there is a blank row it will only create the chart from the first blank row up.
I need the chart to be created from the very last row of data up.
I have this macro that finds all data in columns A:D, creates a chart from that data, saves the chart as a .png image then deletes the chart.
It works perfectly when the are no blank rows, but as soon as there is a blank row it will only create the chart from the first blank row up.
I need the chart to be created from the very last row of data up.
Code:
Sub printbulletin()
LstRwInD = Cells("D" & Rows.Count).End(xlUp).Row
Set Rng = Excel.Range("A1:D" & LstRwInD).CurrentRegion
Rng.CopyPicture xlScreen, xlPicture
Set cht = ActiveSheet.ChartObjects.Add(0, 0, Rng.Width + 0.01, Rng.Height + 0.01)
cht.Chart.Paste
cht.Chart.Export strPath & "T:\Homepage\staffbulletin.png"
ActiveSheet.ChartObjects.Delete
End Sub