Assign Macro with Hidden Sheet

  • Thread starter Thread starter Pran
  • Start date Start date
P

Pran

Hi,

I made assign macro in sheet 1 which is linked to sheet 2.
Whenever I hide sheet 2, It wont works and says :

run-time error '1004'
select method of worksheet class failed.

Then it will open VBS array with yellow mark status need to be edited or
something.

How can I solve this problem?

Much Appreciate,
Pran
 
Yes, So far it works !!!

One more question is, if I now protect the sheet with password, then is
there any additional array that I should make?

Many thx for your help,
Pran
 
What are you doing to Sheet2 that needs it to be selected?

Generally Sheets do not have to be selected to work upon them.

Post the code for review.


Gord Dibben MS Excel MVP
 
Sub Corporate_Deed()
'
' Corporate_Deed Macro
'

'
Sheets("A. CORPORATE DEED").Select
Range("B3").Select
End Sub
Sub Home()
'
' Home Macro
'

'
Sheets("MAIN PAGE").Select
Range("B2:G2").Select
End Sub


I should correct previous email, it doesnt work, coz it is linked to another
visible sheet 3, rather than hidden sheet 2.
How can I enter appropriate line?

Regards,
 
Gord's question was why are you selecting anything on that hidden sheet?
There's really not too many things that require that you select anything before
working on it.

But if you want to select a range, you're going to have to make that sheet
visible first:

With worksheets("A. CORPORATE DEED")
.visible = xlsheetvisible
.range("b3").select
End with
 
Back
Top