Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

macros won't work when tabs with data used are hidden

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pywhacket - 22 Mar 2006 18:16 GMT
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 -
Jerry W. Lewis - 22 Mar 2006 18:33 GMT
You can access data without selecting the sheet, such as
   Sheets("Sheet2").Range("B3").Copy

Jerry

> 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.
[quoted text clipped - 3 lines]
> Is there a way around this?
> Thanks -
pywhacket - 22 Mar 2006 18:51 GMT
 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

> 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.
[quoted text clipped - 3 lines]
> Is there a way around this?
> Thanks -
Jerry W. Lewis - 22 Mar 2006 19:22 GMT
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

>   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 -
[quoted text clipped - 11 lines]
> > Is there a way around this?
> > Thanks -
pywhacket - 22 Mar 2006 19:53 GMT
Thank you!

> Macro recording produces very fat code
>
[quoted text clipped - 26 lines]
> > > Is there a way around this?
> > > Thanks -
Jerry W. Lewis - 22 Mar 2006 21:21 GMT
> Thank you!

You're welcome.  Glad it helped.

Jerry
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.