Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am very new to Macros. I have a workbook first sheet sign in sign out of
work and I have a macro attached to each day sign in and sign out (button) but once the button is pushed once I want to deactive it(macro) for that week but I use another macro to copy the weeks entries to sheet 2 on Fridays and clear cells to get ready for the next weeks entries; now when I use the macro to do this I also want to reactivate the ones I have deactivated. In other words once someone has signed in on Monday I do not want them to be able to use that button again till the following Monday after that weeks entries have been moved and sheet reset but then want my macros to work again.Macro code below for first sheet and undermeath code for 2nd sheet. Thanks in advance. Sub currenttime1() ' Time Macro ' Macro recorded 19/04/2010 by cooganb Sheets("Weekly Time Sheet").Unprotect Password:="working925" t = Time() Set Displaytime = Sheets(1).Range("e12") Displaytime.Cells(1, 1) = Str(t) Sheets("Weekly Time Sheet").Protect Password:="working925" End Sub Sub PostandClear() ' ' PostandClear Macro ' Macro recorded 16/04/2010 by cooganb ' ' Keyboard Shortcut: Ctrl+p ' Sheets("AMALGAMATED").Select Sheets("AMALGAMATED").Unprotect Password:="working925" Range("A6").Select Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromRightOrBelow Sheets("Weekly Time Sheet").Select Sheets("Weekly Time Sheet").Unprotect Password:="working925" Range("D24:AL24").Select Selection.Copy Sheets("AMALGAMATED").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Sheets("AMALGAMATED").Protect Password:="working925" Sheets("Weekly Time Sheet").Select ActiveWindow.ScrollColumn = 17 ActiveWindow.ScrollColumn = 16 ActiveWindow.ScrollColumn = 15 ActiveWindow.ScrollColumn = 14 ActiveWindow.ScrollColumn = 13 ActiveWindow.ScrollColumn = 12 ActiveWindow.ScrollColumn = 11 ActiveWindow.ScrollColumn = 10 ActiveWindow.ScrollColumn = 8 ActiveWindow.ScrollColumn = 7 ActiveWindow.ScrollColumn = 6 ActiveWindow.ScrollColumn = 5 ActiveWindow.ScrollColumn = 4 ActiveWindow.ScrollColumn = 3 ActiveWindow.ScrollColumn = 2 ActiveWindow.ScrollColumn = 1 Range("E12").Select Application.CutCopyMode = False Selection.ClearContents Range("E13").Select Selection.ClearContents Range("E15").Select Selection.ClearContents Range("E16").Select Selection.ClearContents Range("E18").Select Selection.ClearContents Range("E19").Select Selection.ClearContents Range("E20").Select Selection.ClearContents Range("G12").Select Selection.ClearContents Range("G13").Select Selection.ClearContents Range("G15").Select Selection.ClearContents Range("G16").Select Selection.ClearContents Range("G18").Select Selection.ClearContents Range("G19").Select Selection.ClearContents Range("G20").Select Selection.ClearContents Range("I12").Select Selection.ClearContents Range("I13").Select Selection.ClearContents Range("I15").Select Selection.ClearContents Range("I16").Select Selection.ClearContents Range("I18").Select Selection.ClearContents Range("I19").Select Selection.ClearContents Range("I20").Select Selection.ClearContents Range("K12").Select Selection.ClearContents Range("K13").Select Selection.ClearContents Range("K15").Select Selection.ClearContents Range("K16").Select Selection.ClearContents Range("K18").Select Selection.ClearContents Range("K19").Select Selection.ClearContents Range("K20").Select Selection.ClearContents Range("M12").Select Selection.ClearContents Range("M13").Select Selection.ClearContents Range("M15").Select Selection.ClearContents Range("M16").Select Selection.ClearContents Range("M18").Select Selection.ClearContents Range("M19").Select Selection.ClearContents Range("M20").Select Selection.ClearContents Range("O12").Select Selection.ClearContents Range("O13").Select Selection.ClearContents Range("O15").Select Selection.ClearContents Range("O16").Select Selection.ClearContents Range("O18").Select Selection.ClearContents Range("O19").Select Selection.ClearContents Range("O20").Select Selection.ClearContents Range("Q12").Select Selection.ClearContents Range("Q13").Select Selection.ClearContents Range("Q15").Select Selection.ClearContents Range("Q16").Select Selection.ClearContents Range("Q18").Select Selection.ClearContents Range("Q19").Select Selection.ClearContents Range("Q20").Select Selection.ClearContents Range("G12").Select Sheets("Weekly Time Sheet").Protect Password:="working925" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deactivate a macro when used and reactivate again | Excel Discussion (Misc queries) | |||
Deactivate / Reactivate the Paste Function in excel | Excel Programming | |||
Deactivate automatic macros on import | Excel Programming | |||
"Shared Workbook" seems to deactivate features like macros | Excel Discussion (Misc queries) | |||
Deactivate then Reactivate UpdateLinks | Excel Programming |