Can anyone tell me why this code produces the error message above?
Sheets("Data").Select
Rows("2:2").Select
Selection.copy
Sheets("Hist").Unprotect
---this row causes problems -----
If Worksheets("Hist").Visible = True Then Sheets("Hist").Visible = True
---------------------------------
Sheets("Hist").Select
Range("A1").End(xlDown).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.Save
Sheets("Hist").Visible = False
That part of it I recorded cos I,ve started having problems with it, and it worked ok twicw and now I have problems with it again. This is the only thing stopping a nice app from working!
Thanks
Sheets("Data").Select
Rows("2:2").Select
Selection.copy
Sheets("Hist").Unprotect
---this row causes problems -----
If Worksheets("Hist").Visible = True Then Sheets("Hist").Visible = True
---------------------------------
Sheets("Hist").Select
Range("A1").End(xlDown).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.Save
Sheets("Hist").Visible = False
That part of it I recorded cos I,ve started having problems with it, and it worked ok twicw and now I have problems with it again. This is the only thing stopping a nice app from working!
Thanks