Hello,
How do I edit the macro below to run from a selected cell location? I would like to be able to run the macro in other rows when I choose, and I'm unsure how to do this. Thank you.
Sub Add_5_Sub_Items()
'
' Add_5_Sub_Items Macro
'
' Keyboard Shortcut: Ctrl+Shift+S
'
Range("A29").Select
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Rows("28:28").Select
Selection.Copy
Rows("29:33").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A29:AO33").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.149998474074526
.PatternTintAndShade = 0
End With
ActiveWindow.LargeScroll ToRight:=-2
Range("A29").Select
ActiveCell.FormulaR1C1 = "=R[-1]C+0.1"
Range("A29").Select
Selection.AutoFill Destination:=Range("A29:A33"), Type:=xlFillDefault
Range("A29:A33").Select
Range("A29:C33").Select
Selection.InsertIndent 1
Rows("29:33").Select
Selection.Font.Italic = True
ActiveWindow.SmallScroll ToRight:=12
Range("AB28").Select
ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,R[1]C:R[5]C)"
Range("AB28").Select
Selection.AutoFill Destination:=Range("AB28:AH28"), Type:=xlFillDefault
Range("AB28:AH28").Select
Range("AH28").Select
Selection.Copy
ActiveWindow.SmallScroll ToRight:=3
Range("AK28").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("AL28").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveWindow.SmallScroll ToRight:=1
ActiveWindow.LargeScroll ToRight:=-2
End Sub
How do I edit the macro below to run from a selected cell location? I would like to be able to run the macro in other rows when I choose, and I'm unsure how to do this. Thank you.
Sub Add_5_Sub_Items()
'
' Add_5_Sub_Items Macro
'
' Keyboard Shortcut: Ctrl+Shift+S
'
Range("A29").Select
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Rows("28:28").Select
Selection.Copy
Rows("29:33").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A29:AO33").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.149998474074526
.PatternTintAndShade = 0
End With
ActiveWindow.LargeScroll ToRight:=-2
Range("A29").Select
ActiveCell.FormulaR1C1 = "=R[-1]C+0.1"
Range("A29").Select
Selection.AutoFill Destination:=Range("A29:A33"), Type:=xlFillDefault
Range("A29:A33").Select
Range("A29:C33").Select
Selection.InsertIndent 1
Rows("29:33").Select
Selection.Font.Italic = True
ActiveWindow.SmallScroll ToRight:=12
Range("AB28").Select
ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,R[1]C:R[5]C)"
Range("AB28").Select
Selection.AutoFill Destination:=Range("AB28:AH28"), Type:=xlFillDefault
Range("AB28:AH28").Select
Range("AH28").Select
Selection.Copy
ActiveWindow.SmallScroll ToRight:=3
Range("AK28").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("AL28").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveWindow.SmallScroll ToRight:=1
ActiveWindow.LargeScroll ToRight:=-2
End Sub