Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default change named range

hi,

i am trying to yield/get at this new range programmatically:
=lookup!$AB$14:OFFSET(lookup!$AB$14,lookup!$AC$100 ,0)

by using:
ActiveWorkbook.Names.Add Name:="MONTH_SOURCE2", RefersToR1C1:= _
"='lookup'!R1C28:OFFSET('lookup'!R1C28, 'lookup'!R" & NEWMO3 & "C29"

but i cant figure out what is wrong with my syntax.

thanks in advance,
geebee

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default change named range

On Aug 8, 1:18 pm, geebee (noSPAMs) wrote:
hi,

i am trying to yield/get at this new range programmatically:
=lookup!$AB$14:OFFSET(lookup!$AB$14,lookup!$AC$100 ,0)

by using:
ActiveWorkbook.Names.Add Name:="MONTH_SOURCE2", RefersToR1C1:= _
"='lookup'!R1C28:OFFSET('lookup'!R1C28, 'lookup'!R" & NEWMO3 & "C29"

but i cant figure out what is wrong with my syntax.

thanks in advance,
geebee


Guess number one: I think you might need parens around your lookup
functions??

= lookup(parameters,range) I never us R1C1 notation so you may be able
to omit parens using that syntax.

eholz1
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default change named range

it is kinda difficult to determine exactly what you want from your post so
here is generally one way to do named ranges

dim rng as range

with sheets("Lookup")
set rng = .range(.range("AB1"), .cells(rows.count, "AC").end(xlup))
end with

Thisworkbook.names.add Name:="MONTH_SOURCE2", RefersToRange:=rng

This creates a named range from AB1:AC?? where ?? is the last populated row
in AC.
--
HTH...

Jim Thomlinson


"geebee" wrote:

hi,

i am trying to yield/get at this new range programmatically:
=lookup!$AB$14:OFFSET(lookup!$AB$14,lookup!$AC$100 ,0)

by using:
ActiveWorkbook.Names.Add Name:="MONTH_SOURCE2", RefersToR1C1:= _
"='lookup'!R1C28:OFFSET('lookup'!R1C28, 'lookup'!R" & NEWMO3 & "C29"

but i cant figure out what is wrong with my syntax.

thanks in advance,
geebee

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default change named range

I don't see that last comma, zero and close paren: ,0)
in your code.

ActiveWorkbook.Names.Add Name:="MONTH_SOURCE2", RefersToR1C1:= _
"='lookup'!R1C28:OFFSET('lookup'!R1C28, 'lookup'!R" & NEWMO3 & "C29,0)"

geebee wrote:

hi,

i am trying to yield/get at this new range programmatically:
=lookup!$AB$14:OFFSET(lookup!$AB$14,lookup!$AC$100 ,0)

by using:
ActiveWorkbook.Names.Add Name:="MONTH_SOURCE2", RefersToR1C1:= _
"='lookup'!R1C28:OFFSET('lookup'!R1C28, 'lookup'!R" & NEWMO3 & "C29"

but i cant figure out what is wrong with my syntax.

thanks in advance,
geebee


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default change named range

hi,

i want to be able to know how to change the named range while also adding
the header row in row 1. for example, if the new range is like rows 56 - 99,
this new range does not include the header row, so i cant use it as a graph
source. what do i need to do?

thanks in advance,
geebee


"Dave Peterson" wrote:

I don't see that last comma, zero and close paren: ,0)
in your code.

ActiveWorkbook.Names.Add Name:="MONTH_SOURCE2", RefersToR1C1:= _
"='lookup'!R1C28:OFFSET('lookup'!R1C28, 'lookup'!R" & NEWMO3 & "C29,0)"

geebee wrote:

hi,

i am trying to yield/get at this new range programmatically:
=lookup!$AB$14:OFFSET(lookup!$AB$14,lookup!$AC$100 ,0)

by using:
ActiveWorkbook.Names.Add Name:="MONTH_SOURCE2", RefersToR1C1:= _
"='lookup'!R1C28:OFFSET('lookup'!R1C28, 'lookup'!R" & NEWMO3 & "C29"

but i cant figure out what is wrong with my syntax.

thanks in advance,
geebee


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default change named range

I would copy the header to a new worksheet, then copy the rows I want under that
header on the new sheet.

(If I understand correctly????)

geebee wrote:

hi,

i want to be able to know how to change the named range while also adding
the header row in row 1. for example, if the new range is like rows 56 - 99,
this new range does not include the header row, so i cant use it as a graph
source. what do i need to do?

thanks in advance,
geebee

"Dave Peterson" wrote:

I don't see that last comma, zero and close paren: ,0)
in your code.

ActiveWorkbook.Names.Add Name:="MONTH_SOURCE2", RefersToR1C1:= _
"='lookup'!R1C28:OFFSET('lookup'!R1C28, 'lookup'!R" & NEWMO3 & "C29,0)"

geebee wrote:

hi,

i am trying to yield/get at this new range programmatically:
=lookup!$AB$14:OFFSET(lookup!$AB$14,lookup!$AC$100 ,0)

by using:
ActiveWorkbook.Names.Add Name:="MONTH_SOURCE2", RefersToR1C1:= _
"='lookup'!R1C28:OFFSET('lookup'!R1C28, 'lookup'!R" & NEWMO3 & "C29"

but i cant figure out what is wrong with my syntax.

thanks in advance,
geebee


--

Dave Peterson


--

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
Named range in chart - any way to change the workbook reference with VBA Graham Whitehead Excel Programming 1 October 23rd 07 03:02 PM
Named Range Change Based On AutoFilter SanctifiedRock Excel Programming 3 May 16th 06 03:27 PM
Change event triggered by a named range Sean Excel Programming 4 August 1st 05 03:01 AM
Change Event on a named range GregR Excel Programming 2 July 12th 05 09:37 PM
Change named range value Joe Boucher Excel Programming 2 September 30th 04 01:41 AM


All times are GMT +1. The time now is 07:19 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"