LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default dynamic named ranges

Hi,
I found this on the web
offset(indirect(address(match("H*",sheet1!$a$2:$a$ 1000,0)
+1,1)),0,0,countif(sheet1!$a$2:$a$1000,"H*"),1)
It works fine when entered as a named range in the ss.
When I try to use it in VBA it errors.

ActiveWorkbook.Names.Add Name:="test",
RefersToR1C1:="=OFFSET(INDIRECT(ADDRESS(MATCH(" & "h*"
& ",Sheet1!$A$2:$A$1000,0)+1,1)),0,0,COUNTIF(She et1!
$A$2:$A$1000," & "h*" & "),1)"

I hope it has something to do with the quotes not the use
of indirect.
I want to be able to replace the "h*" with a variable.

Any help greatly appreciated.

peter
 
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
Dynamic Named Ranges - is this possible? Code Numpty Excel Worksheet Functions 2 March 10th 10 04:01 PM
Dynamic Named Ranges CellShocked Excel Worksheet Functions 3 October 31st 09 05:30 AM
Dynamic Named Ranges SJT Excel Discussion (Misc queries) 4 June 9th 06 11:13 PM
Dynamic Named Ranges [email protected] Charts and Charting in Excel 0 March 9th 06 03:09 PM
Dynamic Named Ranges clane Excel Discussion (Misc queries) 5 October 13th 05 03:26 PM


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