Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default macros won't work when tabs with data used are hidden

Hi! I have macros that on a worksheet that run off data on worksheets, in the
same workbook, that need to be hidden when the workbook is distributed.
Whenever I hide them my macros Iget runtime error '1004' Select method of
worksheet class failed.

Is there a way around this?
Thanks -
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default macros won't work when tabs with data used are hidden

You can access data without selecting the sheet, such as
Sheets("Sheet2").Range("B3").Copy

Jerry

"pywhacket" wrote:

Hi! I have macros that on a worksheet that run off data on worksheets, in the
same workbook, that need to be hidden when the workbook is distributed.
Whenever I hide them my macros Iget runtime error '1004' Select method of
worksheet class failed.

Is there a way around this?
Thanks -

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default macros won't work when tabs with data used are hidden

I am very much a novice when it comes to VBA, Ia m trying to learn. I
substituted what is below and I get runtime error 9 Subscript out of range -
what am I doing wrong


Application.ScreenUpdating = False
Sheets("Sheet10").Select
Range("A1").Selec

"pywhacket" wrote:

Hi! I have macros that on a worksheet that run off data on worksheets, in the
same workbook, that need to be hidden when the workbook is distributed.
Whenever I hide them my macros Iget runtime error '1004' Select method of
worksheet class failed.

Is there a way around this?
Thanks -

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default macros won't work when tabs with data used are hidden

Macro recording produces very fat code

Sheets("Sheet10").Select
Range("A1").Select

can be collapsed into

Sheets("Sheet10").Range("A1").Select

which would still error. You did not include the action to be performed on
A1, but that too can probably be combined together into a single statment
that does not involve Select (see my previous poste for an example).

Jerry

"pywhacket" wrote:

I am very much a novice when it comes to VBA, Ia m trying to learn. I
substituted what is below and I get runtime error 9 Subscript out of range -
what am I doing wrong


Application.ScreenUpdating = False
Sheets("Sheet10").Select
Range("A1").Selec

"pywhacket" wrote:

Hi! I have macros that on a worksheet that run off data on worksheets, in the
same workbook, that need to be hidden when the workbook is distributed.
Whenever I hide them my macros Iget runtime error '1004' Select method of
worksheet class failed.

Is there a way around this?
Thanks -

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default macros won't work when tabs with data used are hidden

Thank you!

"Jerry W. Lewis" wrote:

Macro recording produces very fat code

Sheets("Sheet10").Select
Range("A1").Select

can be collapsed into

Sheets("Sheet10").Range("A1").Select

which would still error. You did not include the action to be performed on
A1, but that too can probably be combined together into a single statment
that does not involve Select (see my previous poste for an example).

Jerry

"pywhacket" wrote:

I am very much a novice when it comes to VBA, Ia m trying to learn. I
substituted what is below and I get runtime error 9 Subscript out of range -
what am I doing wrong


Application.ScreenUpdating = False
Sheets("Sheet10").Select
Range("A1").Selec

"pywhacket" wrote:

Hi! I have macros that on a worksheet that run off data on worksheets, in the
same workbook, that need to be hidden when the workbook is distributed.
Whenever I hide them my macros Iget runtime error '1004' Select method of
worksheet class failed.

Is there a way around this?
Thanks -



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default macros won't work when tabs with data used are hidden

"pywhacket" wrote:

Thank you!


You're welcome. Glad it helped.

Jerry
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
my worksheet tabs are hidden David Excel Discussion (Misc queries) 2 July 14th 08 01:58 AM
Tabs hidden [email protected] Excel Discussion (Misc queries) 1 January 26th 06 03:20 PM
Hidden tabs CWH Excel Discussion (Misc queries) 3 July 29th 05 01:59 PM
excel macros truncating tabs for hidden columns. SharanS Excel Discussion (Misc queries) 0 February 17th 05 05:05 AM
Hidden tabs [email protected] Excel Discussion (Misc queries) 3 January 19th 05 07:11 PM


All times are GMT +1. The time now is 11:26 AM.

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

About Us

"It's about Microsoft Excel"