Unfortunately it did not work. Any other thoughts? My full code is below:
Sub GenerateGraph()
'
' GenerateGraph Macro
'
Dim myValue As Variant
myValue = InputBox("Enter the Name of Client Return Stream", "Graph Name", "Client Graph")
Range("I1").Value = myValue
ActiveSheet.Select
ActiveSheet.Name = myValue
Sheets.Add
Cells.Select
With Selection.Font
.Name = "Calibri"
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With Selection.Font
.ThemeColor = xlThemeColorAccent1
.TintAndShade = -0.249977111117893
End With
Range("A1").Value = myValue
Range("A2").Select
ActiveCell.FormulaR1C1 = "CUMULATIVE GROWTH OF CAPITAL SINCE INCEPTION"
Range("A3").Select
ActiveCell.FormulaR1C1 = "NET OF FEES AS OF:"
Range("D3").Select
ActiveCell.FormulaR1C1 = _
"=UPPER(TEXT(INDEX(Sheets(" & myValue & ")!C[-2],COUNTA(Sheets(" & myValue & ")!C[-2]),1),""mmmm d, yyyy""))"
Range("A5").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
ActiveChart.PlotArea.Select
ActiveChart.SetSourceData Source:=Sheets(myValue). _
Columns("I:N")
ActiveChart.SeriesCollection(1).XValues = _
"=sheets(" & myValue & ")!B2:B500"
ActiveChart.ChartArea.Select
ActiveSheet.Shapes("Chart 1").IncrementLeft -518.25
ActiveSheet.Shapes("Chart 1").IncrementTop -131.25
ActiveSheet.Shapes("Chart 1").ScaleWidth 1.5270833333, msoFalse, _
msoScaleFromTopLeft
ActiveSheet.Shapes("Chart 1").ScaleHeight 2.0347222222, msoFalse, _
msoScaleFromTopLeft
ActiveChart.PlotArea.Select
Selection.Width = 428.388
ActiveChart.ChartArea.Select
ActiveSheet.Shapes("Chart 1").ScaleWidth 1.1664394338, msoFalse, _
msoScaleFromTopLeft
ActiveSheet.Shapes("Chart 1").ScaleHeight 1.1160409556, msoFalse, _
msoScaleFromTopLeft
ActiveSheet.Shapes("Chart 1").IncrementLeft -15.7499212598
ActiveSheet.Shapes("Chart 1").IncrementTop -18.75
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveSheet.Shapes("Chart 1").Height = 412.56
ActiveSheet.Shapes("Chart 1").Width = 708.48
Dim mySrs As Series
Dim nPts As Long
For Each mySrs In ActiveChart.SeriesCollection
With mySrs
nPts = .Points.Count
mySrs.Points(nPts).ApplyDataLabels _
Type:=xlDataLabelsShowValue, _
AutoText:=True, LegendKey:=False
mySrs.Points(nPts).DataLabel.Text = mySrs.Name
End With
Next
End Sub
Bookmarks