Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
cinvic
 
Posts: n/a
Default Macros and worksheets

I have a formula in a macro to work with worksheets that are named
differently. The formula requires that the name of the worksheet be placed
(i.e. "Wheaton") in the code.

Set ws = wb.Worksheets("Wheaton")

If I want this macro to work with the active worksheet how would I designate
it as the active worksheet.

Set ws = wb.ActiveworkSheet ?

Thanks for your help,
cinvic
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Macros and worksheets

set ws = wb.activesheet



cinvic wrote:

I have a formula in a macro to work with worksheets that are named
differently. The formula requires that the name of the worksheet be placed
(i.e. "Wheaton") in the code.

Set ws = wb.Worksheets("Wheaton")

If I want this macro to work with the active worksheet how would I designate
it as the active worksheet.

Set ws = wb.ActiveworkSheet ?

Thanks for your help,
cinvic


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
cinvic
 
Posts: n/a
Default Macros and worksheets

Hey Mr. Peterson! Hope you're doing ok. Thanks again for you help.

"Dave Peterson" wrote:

set ws = wb.activesheet



cinvic wrote:

I have a formula in a macro to work with worksheets that are named
differently. The formula requires that the name of the worksheet be placed
(i.e. "Wheaton") in the code.

Set ws = wb.Worksheets("Wheaton")

If I want this macro to work with the active worksheet how would I designate
it as the active worksheet.

Set ws = wb.ActiveworkSheet ?

Thanks for your help,
cinvic


--

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
How can I lock worksheets while macros can still enter into them? enginguven Excel Discussion (Misc queries) 3 January 12th 06 01:56 AM
How can I lock worksheets while still allowing macros to operate? enginguven Excel Discussion (Misc queries) 2 January 9th 06 11:06 PM
Hide worksheets if macros are disable Eintsein_mc2 Excel Discussion (Misc queries) 2 September 17th 05 07:37 PM
macros affecting different worksheets CJW Excel Discussion (Misc queries) 1 September 2nd 05 04:29 PM
Unhide Worksheets (hidden via macros) Mark Excel Discussion (Misc queries) 1 June 7th 05 05:21 PM


All times are GMT +1. The time now is 02:34 PM.

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"