moorecp
Feb 6, 2010, 04:57 PM
Brand new to macros. I want to create a macro that will change the formatting of 5 cells starting with the cell I am sitting in when I hit "run macro". Below is my macro now.
Sub Macro1()
'
' Macro1 Macro
'
'
Range("A3:E3").Select
With Selection.Font
.FontStyle = "Regular"
.Strikethrough = True
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.499984741
End With
End Sub
But no matter where I am in the worksheet, when I run the macro - it starts at A3 and ends with E3. I want to be able to start the macro in, say C21, and have it change the formatting in cells C21 through G21 - without having to have a separate macro for each group of cells I want to change formatting.
Sub Macro1()
'
' Macro1 Macro
'
'
Range("A3:E3").Select
With Selection.Font
.FontStyle = "Regular"
.Strikethrough = True
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.499984741
End With
End Sub
But no matter where I am in the worksheet, when I run the macro - it starts at A3 and ends with E3. I want to be able to start the macro in, say C21, and have it change the formatting in cells C21 through G21 - without having to have a separate macro for each group of cells I want to change formatting.