I would appreciate if someone can help me with this code
-- I have dynamic rows and columns, the code finds number of rows and columns using LastRow, and LastColumn. I have to plot line chart for each row (keeping the coulmn fixed at the number found) and place it in sheet 2. I created a hybrid code with recording and looping (As i am a new to coding). The excel sheet table i have to plot is given below (and it can be dynamic both in rows and columns. Cell, Counter etc are header, First row is A ,Nbr, etc ). Please Help
Cell Counter 0:45 1:00 1:15 1:30 1:45 2:00 2:15 2:30
A Nbr 10 54 45 0 0 0 0 0
Dim i As Long
Dim LastRow As Long
Dim LastColumn As Long
Dim cht As Chart
LastRow = Range("A65536").End(xlUp).row
LastColumn = Range("A1").End(xlToRight).Column
For i = 2 To LastRow
Dim location As String
Range("$A$i:$LastColumn").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
ActiveChart.SetSourceData Source:=Range("Sheet1!$A$i:$LastColumn")
With ActiveChart.Parent
.Height = 225 ' resize
.Width = 500 ' resize
ActiveChart.ChartArea.Copy
Sheets("Sheet2").Select
ActiveSheet.Pictures.Paste.Select
Sheets("Sheet1").Select
Application.Run ("DeleteEmbeddedCharts")
End With
Next i
End Sub
