Nerdalert314
New Member
- Joined
- Mar 28, 2018
- Messages
- 23
Good afternoon,
I created the following macro to move a few numbers and then clear data from cells. The macro works perfect. I was hoping to add a clear button for some to just push when they needed to clear the spreadsheet. When assigning the macro to the button (on sheet "Blotter") it tries to process the whole macro on this sheet. It doesn't read selecting the other sheets and it eventually errors out. I have never used buttons before. Can anyone provide insight?
I created the following macro to move a few numbers and then clear data from cells. The macro works perfect. I was hoping to add a clear button for some to just push when they needed to clear the spreadsheet. When assigning the macro to the button (on sheet "Blotter") it tries to process the whole macro on this sheet. It doesn't read selecting the other sheets and it eventually errors out. I have never used buttons before. Can anyone provide insight?
HTML:
Sub Clear()
'
' Clear Macro
Sheets("Blotter").Select
Range("C9").Copy
Range("K6").PasteSpecial PASTE:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("K44").Copy
Range("K4").PasteSpecial PASTE:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("K44,K10:K14, K17:K18, K25:K31").FormulaR1C1 = "0"
Range("E10:E15,E17:E35, D49:D51").ClearContents
Sheets("Difference Ticket Totals").Select
Range("B4").Copy
Range("B1").PasteSpecial PASTE:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Shadow Posting").Select
Range("B6:D6").Copy
Range("B2").PasteSpecial PASTE:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B6:D6").ClearContents
Range("B12:C12,B17:C17,B26:C26,B34:C34,E12:E15,E17:E24,E26:E32,E34:E38,G24,G32,G34:G38").ClearContents
Sheets("Outstanding Checks").Select
Range("B3:B9").Copy
Range("C3").PasteSpecial PASTE:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B6:B8").FormulaR1C1 = "0"
Sheets("BLP Balances").Select
Range("B6").Copy
Range("B2").PasteSpecial PASTE:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B6, E2:E3").FormulaR1C1 = "0"
Sheets("Staff Proofs-BCS").Select
Range("D97:D98, E97:E98, G97:G98").FormulaR1C1 = "0"
Range("A67:A86").FormulaR1C1 = "NDT"
Range("A67:A86").Select
With Selection.Interior
.Pattern = xlNone
End With
Range("B4:Q17, B19:Q54, B59:Q86").FormulaR1C1 = "0"
Range("A35:A54").FormulaR1C1 = "CDT#"
Range("A35:A54").Select
With Selection.Interior
.Pattern = xlNone
End With
Sheets("Blotter").Select
Range("B1:M1").Select
End Sub