Assign Macro with Hidden Sheet

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
 
P

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
 
G

Gord Dibben

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
 
P

Pran

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,
 
D

Dave Peterson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top