Hi!
I'm trying to create named ranges dynamically, and I found a way to make it work, but my problem is that it would create the named ranges with worksheet scope instead of global (workbook) scope. I need to refer to these ranges from other tabs, so it would be essential for me to solve this.
Here is my code:
nextColumn = sh_Controls.Cells(11, Columns.count).End(xlToLeft).Column + 6
bndlCount = Application.WorksheetFunction.CountA(Range("11:11")) - 2
Set rngNewBndl = Range(Cells(10, nextColumn), Cells(10, nextColumn).Offset(12, 5))
sh_Controls.Names.Add Name:="rng_Bundle" & bndlCount & "_Name", RefersTo:=rngNewBndl.Range("E4")
sh_Controls.Names.Add Name:="rng_Bundle" & bndlCount & "_Type", RefersTo:=rngNewBndl.Range("E6")
sh_Controls.Names.Add Name:="rng_Bundle" & bndlCount & "_SOCs", RefersTo:=rngNewBndl.Range("E8:E12")
How could I modify this to have the above ranges defined with global scope?
Thanks!
Bookmarks