In how many ways we can create Macros?
In how many ways can perform record macro
Click on Developer Tab
Click on "Record Macro" under CODE group
Click on VIEW Tab
Under the "Macros" group click on RECORD MACRO
Absolute Reference & Relative Reference
Relative Reference
Absolute Vs Relative Reference
Sub absolute_reference()
'
' absolute_reference Macro
'
'
Range("B4").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("B5").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent2
.TintAndShade = -0.499984740745262
.PatternTintAndShade = 0
End With
End Sub
Sub Relative_Refernce()
'
' Relative_Refernce Macro
'
'
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 192
.TintAndShade = 0
.PatternTintAndShade = 0
End With
ActiveCell.Offset(1, 0).Range("A1").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent3
.TintAndShade = -0.249977111117893
.PatternTintAndShade = 0
End With
End Sub
Autofilter - Add & Remove
Sub Add_Autofilter()
'
' Add_Autofilter Macro
'
'
Range("A1:F1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$F$130").AutoFilter Field:=2, Criteria1:="Banana"
End Sub
Sub removeautofilter()
'
' removeautofilter Macro
'
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "Item"
Range("A1").Select
Selection.AutoFilter
End Sub
Record Macro - Color a Table
Record Macro - Live Code Generation
Record Macro - Countif Function