Excel 97 runtime Issue

D

Dean

Ladies and Gents,

Hoping I can get some help here. I listed something similar previously
(didnt get any replies) as I didnt explain myself very well. Sorry if I
offend reposting a slightly modified post....

I really really need some help with the code below. It works fine in xl
2003 but I receive a Runtime Error 13 - type mismatch in XL 97 which is
what I use at work. To tell you the truth I do not know why? and have
played with this for hours. Sorry but I lack the skills to trouble
shoot this.

I have both numbers and text on the sheet where this macro runs and
essentially I need it to hide columns that have zero's. I am not sure
why I generates the error in xl97 but doesnt in xl2003 but I hope
someone could assist me to resolve this.

Thanks for your patience.

Dean


Sub Macro4()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
ActiveSheet.DisplayPageBreaks = False
ActiveSheet.Unprotect Password:="my password"
MsgBox "Labels Spooled to Printer" & Chr(13) & "Click OK to Proceed" &
Chr(10)
LR = Range("B991").End(xlUp).Row ' Determine the last used row
For Each cell In Range("B1:B" & CStr(LR))
If cell.Value = 0 Then
Rows(cell.Row).EntireRow.Hidden = True
End If
Next cell
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Cells.EntireRow.Hidden = False
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
ActiveSheet.Protect Password:="my password"
Application.Run Macro:="Macro6"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top