Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a limit on how much code you can place in a VBA file?*
All works well except the macro I call "VacUsed"* It is called from a couple of procedures I post the last procedure*"ThisWorkBook" use to close and save the workbook.* Private Sub Workbook_BeforeClose(Cancel As Boolean)* * * Call FilterTestOff* * * Call VacUsed* * * Call DeleteMenu* * * Call AllProtect* * * Sheets("VacationAccrued").Activate* End Sub* Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As*Boolean)* * * Call AllProtect* * * Sheets("VacationAccrued").Activate* End Sub* And this is the VacUsed Procedu* Sub VacUsed()* '* ' VacUsed Macro* ' Macro recorded 5/16/2008 by Geoffrey Feldman* '* ' Stores "Vacation Days Taken" from Vacation Accured Sheet* '* * * Set Wkb = ActiveWorkbook* * * Set ShtA = Wkb.Worksheets("VacationAccrued")* * * inLRw = ShtA.Cells(Rows.Count, "B").End(xlUp).End(xlUp).Row* * * Set ShtS = Wkb.Worksheets("VacUsedStorage")* * * ShtS.Activate* * * Call shUnprotect* * * ShtS.Range("B2:C1000").ClearContents* ' *Update VacUsed Names from VacAccrue* * * ShtS.Range("B2:B" & inLRw - 1).Value = ShtA.Range("B3:B" &*inLRw).Value* ' *Update VacUsed Days Taken from VacAccrue* * * ShtS.Range("C2:C" & inLRw - 1).Value = ShtA.Range("I3:I" &*inLRw).Value* * * ShtS.Columns("B:C").EntireColumn.AutoFit* * * Range("B2").Select* * * Application.CutCopyMode = False* * * Call shProtect* * * ShtA.Activate* * * Range("B3").Select* End Sub* The macro skips the call "shUnProtect" which is needed to continue the* update process* Your expert help would be appreciated* |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula doesn't work this morning, but worked for 2 years now | Excel Worksheet Functions | |||
calculate years worked by 3% * salary in excel | Excel Worksheet Functions | |||
Function has worked for 5 years is now in error | Excel Worksheet Functions | |||
Formula that will represent years & months worked | Excel Discussion (Misc queries) | |||
Excel Formula - Compute Number of Years Worked | Excel Discussion (Misc queries) |