PDA

View Full Version : [SOLVED:] How to add/copy Dynamic Named Ranges to Workbook



oam
10-26-2023, 12:15 PM
I need to know a couple of things, can VBA copy Dynamic Named Ranges to a list within a worksheet and then can the Dynamic Named Ranges be added to a workbook using VBA?

I need to copy several lines of code similar to the one shown and add them another workbook?





OFFSET(Lookup!$F$26,0,0,COUNTIF(Lookup!$F$26:$F$65539,">*"),1)

Thank you for any and all help!

Aussiebear
10-26-2023, 12:51 PM
I like your optimism oam, but what does this represent ">*"..... ???

oam
10-26-2023, 02:12 PM
Aussiebear,

Does "I like your optimism" mean VBA is not able to copy or add Dynamic Named Ranges? As far as ">*", I am not sure what this does but I have used this in the Named Ranges area to allow a Data Validation List to be adjusted without adjusting the Named Range.

oam
10-27-2023, 12:54 PM
modified a code I received from an earlier post from p45cal to allow me to add the Dynamic Named Range shown in this post.

Thank you for your help p45cal


ActiveWorkbook.Names.Add Name:=cll.Value, RefersTo:="=" & cll.Offset(, 2).Value