Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 26
Default Assign Macro with Hidden Sheet

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default Assign Macro with Hidden Sheet

Hi,

Instead of

Sheets("Sheet2").Select

use

Sheets("Sheet2").Activate

If this fails then you should enter the appropriate line in the procedure to
unhide the sheet, run your code and re-hide the sheet when the code has
completed

Alan

--
Message posted via http://www.officekb.com

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 26
Default Assign Macro with Hidden Sheet

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

"Alan McQuaid via OfficeKB.com" wrote:

Hi,

Instead of

Sheets("Sheet2").Select

use

Sheets("Sheet2").Activate

If this fails then you should enter the appropriate line in the procedure to
unhide the sheet, run your code and re-hide the sheet when the code has
completed

Alan

--
Message posted via http://www.officekb.com


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Assign Macro with Hidden Sheet

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

On Fri, 24 Jul 2009 00:16:02 -0700, Pran
wrote:

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


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 26
Default Assign Macro with Hidden Sheet

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 Dibben" wrote:

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

On Fri, 24 Jul 2009 00:16:02 -0700, Pran
wrote:

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





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Assign Macro with Hidden Sheet

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



Pran wrote:

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 Dibben" wrote:

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

On Fri, 24 Jul 2009 00:16:02 -0700, Pran
wrote:

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




--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to run on hidden sheet Tel Excel Discussion (Misc queries) 4 June 26th 09 09:08 PM
Using a Macro to look at Hidden Sheet alice Excel Discussion (Misc queries) 7 April 20th 07 09:16 AM
Macro Error When Connecting to Hidden Sheet Wuddus Excel Discussion (Misc queries) 5 August 3rd 06 03:34 PM
I need my Hidden Rows to stay hidden when I print the sheet. Rosaliewoo Excel Discussion (Misc queries) 2 July 20th 06 07:51 PM
Can a macro format a hidden sheet? Robert Excel Discussion (Misc queries) 1 February 9th 05 06:13 PM


All times are GMT +1. The time now is 08:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"