Excel VBA Reference
Excel VBA Reference
IN IMMEDIATE WINDW
? Range("C2:B5").Address
Range("C2:B5").Select
Range("C2:B5").Interior.ColorIndex = 4 (green)
Union(Range("A1"),Range("B2"),Range("C5")) -->$A$1,$B$2,$C$5
CELL FORMATTING
Range(someCell).Font.Bold = True
Range(someCell).Font.Underline = xlDouble
ADD NAME
CREATE CHARTS
Sub CreateChart()
'PURPOSE: Create a chart (chart dimensions are not required)
'Create a chart
Set cht = ActiveSheet.Shapes.AddChart2
End Sub
Sub CreateChart()
'PURPOSE: Create a chart (chart dimensions are required)
'Create a chart
Set cht = ActiveSheet.ChartObjects.Add( _
Left:=ActiveCell.Left, _
Width:=450, _
Top:=ActiveCell.Top, _
Height:=250)
End Sub
Sub LoopThroughCharts()
'PURPOSE: How to cycle through charts and chart series
Next cht
Next ser
Next ser
Next cht
End Sub
Sub AddChartTitle()
'PURPOSE: Add a title to a specific chart
End Sub
Sub RepositionChartTitle()
'PURPOSE: Reposition a chart's title
'Reposition title
With cht.Chart.ChartTitle
.Left = 100
.Top = 50
End With
End Sub
Sub DimensionChartLegend()
lgd.Left = 240.23
lgd.Top = 6.962
lgd.Width = 103.769
lgd.Height = 25.165
End Sub
Sub DimensionChartLegend()
End Sub
Sub ChangeChartFormatting()
End Sub
Sub RemoveChartFormatting()
'Remove Gridlines
cht.Axes(xlValue).MajorGridlines.Delete
cht.Axes(xlValue).MinorGridlines.Delete
'Remove X-axis
cht.Axes(xlCategory).Delete
'Remove Y-axis
cht.Axes(xlValue).Delete
'Remove Legend
cht.Legend.Delete
'Remove Title
cht.ChartTitle.Delete
End Sub
Sub ChangeChartColors()
End Sub