Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default What is wrong with this code to name a worksheet range

Your original code expects 'aWS' to be a string, ie the name of a worksheet
in the implicitly referenced Activeworkbook, though not necessarily the
activesheet.

If you've already set a reference to the activesheet, which is what you say
aWS is, -

aWS.Names.Add Name:="PlusMinusCount", RefersTo:="="&count

In passing probably better not name variables same as key-names, such as
'count'

Regards,
Peter T



"Barb Reinhardt" wrote in message
...
aWS is the activesheet.
Count is an integer variable that's defined earlier in the code.

"Peter T" wrote:

What's 'aWS' and 'count'

Regards,
Peter T

"Barb Reinhardt" wrote in

message
...
Worksheets(aWS).Names.Add Name:="PlusMinusCount",

RefersTo:="="&count

Thanks







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
What is wrong with this code? jlclyde Excel Discussion (Misc queries) 5 January 9th 08 05:12 PM
wrong code? minostrada Excel Programming 6 October 26th 05 02:50 PM
What's wrong with this code? PhilipsBernard Excel Programming 4 October 20th 05 07:30 AM
What's wrong with the code,pls hv a look changeable[_4_] Excel Programming 1 November 3rd 04 02:57 AM
Code for naming worksheet name range?? Sandy[_3_] Excel Programming 2 September 7th 03 04:49 AM


All times are GMT +1. The time now is 06:51 PM.

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"