![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
I have a very long spreadsheet and I would like to make a separate chart for each line of the sheet. is it possible to create a macro to generate charts?
Thanks JAS |
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Try this macro, not fully tested. Got most of the code from the Macro recorder.
Code:
Sub Macro1()
Dim i As Long
For i = 2 To Range("A65536").End(xlUp).Row
Charts.Add
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A" & i & ":E" & i)
ActiveChart.Location Where:=xlLocationAsNewSheet 'xlLocationAsObject
Sheets("Sheet1").Select
Next i
End Sub
|
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
Thank you Mr Excel, it worked!
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|