S
Steve Klenner
I'm trying to recreate a macro in Excel2003 that is giving me some
problems...
Here's What I'm trying to do...
1 - Select a group of sheets in a workbook and Unprotect them.
2 - Insert formula in cells G57 and F57 in each of selected sheets
3 - ReProtect selected sheets with password.
4 - Return to "Quote Totals" worksheet
I've included two macros...
1 - This Macro works in an old workbook that still works in Excel2003..
But does NOT work when I've save it in 2003.
2 - My latest attempt at trying to get this macro to work.
I'd really appreciate someones "genius" to get this resolved!
Thanks
Steve
This Macro works in Excel2003 Workbook that was created in Excel 2000
It does NOT work in Excel2003 when I saved it as an Excel 2003 Workbook
It fails at Line.....sht.Unprotect Password:="xxxxx"
It Fails At Line ...ActiveCell.FormulaR1C1 = "=R[-1]C*6%"
************************************************************************
' MISalesTAX_Axx Macro
Application.ScreenUpdating = False
Dim sht as worksheet
'UnProtect specific sheets
For Each sht In Sheets(Array("Circuit Cards", "Endpoints"))
sht.Unprotect Password:="lock"
'Insert Formula in G57 and F57
Range("G57").Select
** Fails Here**ActiveCell.FormulaR1C1 = "=R[-1]C*6%"
Range("F57").Select
ActiveCell.FormulaR1C1 = "MI Sales Tax"
Next sht
'Re-Protect Sheets
For Each sht In Sheets(Array("Circuit Cards", "Endpoints"))
sht.Protect Password:="lock"
Next sht
Sheets("Profile").Select
Application.ScreenUpdating = True
End Sub
problems...
Here's What I'm trying to do...
1 - Select a group of sheets in a workbook and Unprotect them.
2 - Insert formula in cells G57 and F57 in each of selected sheets
3 - ReProtect selected sheets with password.
4 - Return to "Quote Totals" worksheet
I've included two macros...
1 - This Macro works in an old workbook that still works in Excel2003..
But does NOT work when I've save it in 2003.
2 - My latest attempt at trying to get this macro to work.
I'd really appreciate someones "genius" to get this resolved!
Thanks
Steve
This Macro works in Excel2003 Workbook that was created in Excel 2000
It does NOT work in Excel2003 when I saved it as an Excel 2003 Workbook
It fails at Line.....sht.Unprotect Password:="xxxxx"
I've tried to "fix" the macro...this is my latest attempt.*************************************************************
Sub MISalesTAX_Totals()
Application.ScreenUpdating = False
'UnProtect Sheets for Updating
For Each sht In Sheets
**Fails Here**sht.Unprotect Password:="xxxxx"
Next sht
Sheets(Array("Circuit Cards", "Enpoints")).Select
'Select G57 and F57 in each Sheet and input formulas
Range("G57").Select
ActiveCell.FormulaR1C1 = "=R[-1]C*6%"
Range("F57").Select
ActiveCell.FormulaR1C1 = "MI Sales Tax"
'Reselect same sheets and Protect Them
For Each sht In Sheets
ActiveSheet.Select
sht.Protect Password:="xxxxx"
Next sht
'Return to Quote Totals Sheet
Sheets("Quote Totals").Select
Application.ScreenUpdating = True
End Sub
*******************************************************************
*******************************************************************
It Fails At Line ...ActiveCell.FormulaR1C1 = "=R[-1]C*6%"
************************************************************************
' MISalesTAX_Axx Macro
Application.ScreenUpdating = False
Dim sht as worksheet
'UnProtect specific sheets
For Each sht In Sheets(Array("Circuit Cards", "Endpoints"))
sht.Unprotect Password:="lock"
'Insert Formula in G57 and F57
Range("G57").Select
** Fails Here**ActiveCell.FormulaR1C1 = "=R[-1]C*6%"
Range("F57").Select
ActiveCell.FormulaR1C1 = "MI Sales Tax"
Next sht
'Re-Protect Sheets
For Each sht In Sheets(Array("Circuit Cards", "Endpoints"))
sht.Protect Password:="lock"
Next sht
Sheets("Profile").Select
Application.ScreenUpdating = True
End Sub