D
dianeha
Good morning to all!
I am trying to attach a macro I created to a form button in excel 2003. I
click the button however the macro will not run. I thought it might hav
ebeen the security level but I changed that. If anyone can assist me it
would be appreciated. I am new to VBA so please be kind.
Thanks!
Hamm
Sub Clean_for_New_Month()
'
' Clean_for_New_Month Macro
' Macro recorded 12/3/2007 by Diane Hamm
'
' Keyboard Shortcut: Ctrl+q
'
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("ATL").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I41").Select
Selection.Interior.ColorIndex = xlNone
Sheets("BAC").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("BLV").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I41").Select
Selection.Interior.ColorIndex = xlNone
Sheets("CAC").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("CCR").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("CHE").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("CLV").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I41").Select
Selection.Interior.ColorIndex = xlNone
Sheets("COU").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("FLV").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I45").Select
Selection.Interior.ColorIndex = xlNone
Sheets("FTN").Select
Range("H8:I46").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("GBI").Select
Range("H8:I46").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("GTU").Select
Range("H8:I46").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("HBR").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("HLT").Select
ActiveWindow.SmallScroll Down:=-6
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("JOL").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("LAD").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("LAS").Select
ActiveWindow.SmallScroll Down:=-9
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I41").Select
Selection.Interior.ColorIndex = xlNone
Sheets("LAU").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("MET").Select
ActiveWindow.SmallScroll Down:=-9
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Range("H25").Select
ActiveWindow.SmallScroll Down:=18
ActiveWindow.ScrollWorkbookTabs Sheets:=16
Sheets(Array("NKC", "NOR", "REN", "RIN", "RLV", "SAC", "STL", "STU",
"TAH", "UBC", "UEL", _
"UHA", "UTU", "WCL")).Select
Sheets("WCL").Activate
ActiveWorkbook.Sheets("WCL").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("UTU").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("UHA").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("UEL").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("UBC").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("TAH").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("STU").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("STL").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("SAC").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("RLV").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("RIN").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("REN").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("NOR").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("NKC").Tab.ColorIndex = -4142
Sheets(Array("NKC", "NOR", "REN", "RIN", "RLV", "SAC", "STL", "STU",
"TAH", "UBC", "UEL", _
"UHA", "UTU", "WCL")).Select
Sheets("NKC").Activate
ActiveWindow.SmallScroll Down:=-9
Range("H8:I44").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("X").Select
Range("H67").Select
ActiveWindow.SmallScroll Down:=-54
Sheets("WCL").Select
Range("K45").Select
End Sub
I am trying to attach a macro I created to a form button in excel 2003. I
click the button however the macro will not run. I thought it might hav
ebeen the security level but I changed that. If anyone can assist me it
would be appreciated. I am new to VBA so please be kind.
Thanks!
Hamm
Sub Clean_for_New_Month()
'
' Clean_for_New_Month Macro
' Macro recorded 12/3/2007 by Diane Hamm
'
' Keyboard Shortcut: Ctrl+q
'
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("ATL").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I41").Select
Selection.Interior.ColorIndex = xlNone
Sheets("BAC").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("BLV").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I41").Select
Selection.Interior.ColorIndex = xlNone
Sheets("CAC").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("CCR").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("CHE").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("CLV").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I41").Select
Selection.Interior.ColorIndex = xlNone
Sheets("COU").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("FLV").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I45").Select
Selection.Interior.ColorIndex = xlNone
Sheets("FTN").Select
Range("H8:I46").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("GBI").Select
Range("H8:I46").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("GTU").Select
Range("H8:I46").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("HBR").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("HLT").Select
ActiveWindow.SmallScroll Down:=-6
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("JOL").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("LAD").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("LAS").Select
ActiveWindow.SmallScroll Down:=-9
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I41").Select
Selection.Interior.ColorIndex = xlNone
Sheets("LAU").Select
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("MET").Select
ActiveWindow.SmallScroll Down:=-9
Range("H8:I41").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Range("H25").Select
ActiveWindow.SmallScroll Down:=18
ActiveWindow.ScrollWorkbookTabs Sheets:=16
Sheets(Array("NKC", "NOR", "REN", "RIN", "RLV", "SAC", "STL", "STU",
"TAH", "UBC", "UEL", _
"UHA", "UTU", "WCL")).Select
Sheets("WCL").Activate
ActiveWorkbook.Sheets("WCL").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("UTU").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("UHA").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("UEL").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("UBC").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("TAH").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("STU").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("STL").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("SAC").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("RLV").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("RIN").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("REN").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("NOR").Tab.ColorIndex = -4142
ActiveWorkbook.Sheets("NKC").Tab.ColorIndex = -4142
Sheets(Array("NKC", "NOR", "REN", "RIN", "RLV", "SAC", "STL", "STU",
"TAH", "UBC", "UEL", _
"UHA", "UTU", "WCL")).Select
Sheets("NKC").Activate
ActiveWindow.SmallScroll Down:=-9
Range("H8:I44").Select
Selection.ClearContents
Range("G8:I46").Select
Selection.Interior.ColorIndex = xlNone
Sheets("X").Select
Range("H67").Select
ActiveWindow.SmallScroll Down:=-54
Sheets("WCL").Select
Range("K45").Select
End Sub