LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default VBA Excel Macro worked for 2-years now dosen't??

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula doesn't work this morning, but worked for 2 years now Rhop Excel Worksheet Functions 1 October 11th 06 01:54 PM
calculate years worked by 3% * salary in excel laurentium3 Excel Worksheet Functions 2 January 18th 06 12:39 AM
Function has worked for 5 years is now in error umloew43 Excel Worksheet Functions 2 November 22nd 05 02:22 PM
Formula that will represent years & months worked Pam Excel Discussion (Misc queries) 5 August 29th 05 11:20 PM
Excel Formula - Compute Number of Years Worked Penny Excel Discussion (Misc queries) 2 August 11th 05 07:39 PM


All times are GMT +1. The time now is 01:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"