I have the following macro written within Excel 2003 and it works fine. I am not sure as to what was the original version of Excel in which this was written.
However, a user complains that he gets a run time error 1004 as "The cell or chart you are trying to change is protected and therefore read-only ........" in his machine that runs Excel 97/2000.
Here is the code snapshot:
Public Sub PasteForecast()
Sheets("Error History").Visible = True
Sheets("Error History").Select
Range("A2").Select
Do Until ActiveCell.Value = Sheets("2) Forecast Worksheet").Range("C3").Value
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Offset(0, 2).Select
Sheets("2) Forecast Worksheet").Range("C20").Copy
Sheets("Error History").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
The code fails in the last line.
The Error History sheet is Hidden and it has some cells as write protected like Columns B,G,H,I,J etc.
Thanks in advance.
Bookmarks