Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Worksheets(aWS).Names.Add Name:="PlusMinusCount", RefersTo:="="&count
Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What's 'aWS' and 'count'
Regards, Peter T "Barb Reinhardt" wrote in message ... Worksheets(aWS).Names.Add Name:="PlusMinusCount", RefersTo:="="&count Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I just want to confirm that this named reage is intended to be attached to
the sheet and not the entire workbook. You will not see this named range from other sheets... There really is nothing terribly wrong with your code. I would not use count as a varaible since it is a reserved word (a property of a bunch of different objects) . Try this code... dim aWS as worksheet dim lCount as long lcount = 10 set aWS = Activesheet aWS.Names.Add Name:=" Activesheet.).Names.Add Name:="PlusMinusCount", RefersTo:= "=" & lcount -- HTH... Jim Thomlinson "Barb Reinhardt" wrote: Worksheets(aWS).Names.Add Name:="PlusMinusCount", RefersTo:="="&count Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
What is wrong with this code? | Excel Discussion (Misc queries) | |||
wrong code? | Excel Programming | |||
What's wrong with this code? | Excel Programming | |||
What's wrong with the code,pls hv a look | Excel Programming | |||
Code for naming worksheet name range?? | Excel Programming |