does : -
If Worksheets("Hist").Visible = False Then Sheets("Hist").Visible = True
Sheets("Hist").Select
work OK?![]()
This is a discussion on Error 1004 - 'select method of worksheet class failed' within the Excel Questions forums, part of the Question Forums category; 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 ...
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
does : -
If Worksheets("Hist").Visible = False Then Sheets("Hist").Visible = True
Sheets("Hist").Select
work OK?![]()
It used to... about an hour ago. Then stopped and I get the 1004 now. I don't get it - I recorded that bit!
Doh! I realised the mistake as I hit the Submit button! Ok - so that bit's ok, now I get the 1004 on the last bit -
Sheets("Hist").Visible = True
but it says - Unable to set the Visible property on the Worksheet class.
Am I missing something here?
[ This Message was edited by: matthewh on 2002-05-29 05:46 ]
Is your workbook protected? If so, i think you'll have to unprotect it first.
It unprotects it a couple of lines above that, then re-protects it. It's a history of some transactions that I can't have people changing.
You're unprotecting your worksheet there, but is your actual workbook protected, as this can prevent your sheets from being hidden and unhidden?
Bookmarks