View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
[email protected] donna.gough@hydro.com is offline
external usenet poster
 
Posts: 81
Default Another Question Concerning Replacing Formulae With Values !

This code does what I want, but when I press save I get a memory
couldnot be read error so there definately must be a problem somewhere
with the .value=.value line.
I noticed that it only errored on the last iArea even though it had
already changed some similar areas, so I added another sheet into the
loop(Was 1 sheet, now 2 sheets). Now it will jump into the ErrHand line
on the last iArea of the last sheet (it will run through the first
sheet without jumping into the ErrHand !).....

For Each s In ActiveWorkbook.Sheets
s.Activate
s.Unprotect
Cells.Select
Selection.MergeCells = False
Columns("AZ").ColumnWidth = 17.75
For Each iArea In Cells.SpecialCells
_(xlCellTypeFormulas).Areas
iArea.Select
On Error GoTo ErrHand:
iArea.Value = iArea.Value
On Error GoTo 0
Next iArea
Range("AX1").Select
s.Protect
Next s
GoTo End1:
ErrHand:
Resume Next
End1:

......Why should it be erroring out on the last iArea it meets. And why
when I add a sheet does it then complete the sheet that it errored on
before but then error on the last iArea of that new sheet ?