Brent
asked on
Macro Error - Calling a macro to protect sheets
Putting the finishing touches on a project. I built a macro that will unprotect the sheets, then clear the contents of different ranges, then protect the sheet again.
the unprotect and protect are previous marcro's.
I keep gettin an error when it calls to protect the sheet again. Can't figure out why?
thanks
expert.xls
the unprotect and protect are previous marcro's.
I keep gettin an error when it calls to protect the sheet again. Can't figure out why?
thanks
expert.xls
that's SP3, by the way
ASKER
The clear all marco worked?
the protect all and deprotect all work just fine.
It is the Clear all macro that I am having issues with.
thanks
the protect all and deprotect all work just fine.
It is the Clear all macro that I am having issues with.
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I installed the code and it only clears day1, not the other days.
so I am guessing it is not going into group mode.
I'll keep looking at it.
thanks
so I am guessing it is not going into group mode.
I'll keep looking at it.
thanks
oh you could add the following and update the range clear contents
Sheets("first day of pay period").Activate
Range("A4:C31").ClearConte nts
Sheets("2nd day of pay period").Activate
Range("A4:C31").ClearConte nts
Sheets("3rd day of pay period").Activate
Range("A4:C31").ClearConte nts
Sheets("4th day of pay period").Activate
Range("A4:C31").ClearConte nts
Sheets("5th day of pay period").Activate
Range("A4:C31").ClearConte nts
Sheets("first day of pay period").Activate
Range("A4:C31").ClearConte
Sheets("2nd day of pay period").Activate
Range("A4:C31").ClearConte
Sheets("3rd day of pay period").Activate
Range("A4:C31").ClearConte
Sheets("4th day of pay period").Activate
Range("A4:C31").ClearConte
Sheets("5th day of pay period").Activate
Range("A4:C31").ClearConte
ASKER
yes, this worked perfect.
thanks for the time.
thanks for the time.
your macro works fine on my machine, XP SP# and Excel 2003.