Hi,
I'm a newb at VBA and am having a little trouble finding help on what I'm trying to code. Would appreciate any help anyone can provide.
Basically, I am writing a macro to automate the process of creating multiple graphs. I plan to write some code (later)which will output a list of row numbers. I need this code to be able to loop through that list and create a graph for each of those rows.
I tried to define variables for the data range so that I can loop through and just change the variable, but I don't think I am doing it correctly. Any advice?
I'm a newb at VBA and am having a little trouble finding help on what I'm trying to code. Would appreciate any help anyone can provide.
Basically, I am writing a macro to automate the process of creating multiple graphs. I plan to write some code (later)which will output a list of row numbers. I need this code to be able to loop through that list and create a graph for each of those rows.
I tried to define variables for the data range so that I can loop through and just change the variable, but I don't think I am doing it correctly. Any advice?
Code:
Sub LoudnessChart()
Dim LChart As ChartObject
Dim Lrange As Range
Dim Lrow As String
Dim Lstr As String
Dim Lname As String
Lrow = 170
Lstr = "Range(" & Chr(34) & "Summary!G" & Lrow & ":V" & Lrow & Chr(34) & ").Values"
Set Lrange = Lstr
Windows("Sorted.xls").Activate
Sheets("Temp").Select
Set LChart = ActiveSheet.ChartObjects.Add _
(Left:=100, Width:=375, Top:=75, Height:=225)
'
LChart.Chart.SetSourceData Source:=Lrange
LChart.Chart.ChartType = xlColumnClustered
LChart.Chart.SeriesCollection(1).XValues = "=Summary!R3C7:R4C22"
Lname = Chr(34) & "=Summary!R" & Lrow & "C3" & Chr(34)
LChart.Chart.SeriesCollection(1).Name = Lname
With Schart.Chart
.HasTitle = True
.ChartTitle.Characters.Text = "Power Door Lock Power Lock Peak Sharpness"
.Axes(xlCategory).HasTitle = False
.Axes(xlCategory).TickLabelSpacing = 1
.Axes(xlCategory).TickLabels.Orientation = xlUpward
.Axes(xlValue).HasTitle = True
.Axes(xlValue).AxisTitle.Characters.Text = "Acum"
.HasLegend = False
End With
End Sub