Appendix G Excel Macro
G-5
Data_Area = "A29:B" & LTrim(Str(28 + Smple_Cnt))
End If
'
' Creating Graph
' '
Charts.Add
ActiveChart.ChartType = xlXYScatterLinesNoMarkers
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range(Data_Area), PlotBy _
:=xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet
ActiveChart.SeriesCollection(1).Name = Trc_num
ActiveChart.PlotArea.Select
Selection.Width = 600
Selection.Height = 370
Selection.Left = 50
Selection.Top = 55
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = File_name
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Wavelength [nm]"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Power [mW]"
End With
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = True
.HasMinorGridlines = True
.MinimumScale = Start_Wl
.MaximumScale = Stop_Wl
.MinorUnit = (Stop_Wl - Start_Wl) / 10
.MajorUnit = (Stop_Wl - Start_Wl) / 2
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = True
.HasMinorGridlines = True
.MinimumScale = 0
.MaximumScaleIsAuto = True
.MinorUnit = .MaximumScale / 10