I had some code to do this in a previous job but can no longer find it, despite an extensive google!
If in a spreadsheet I selected a 2 column range and in the first column was the name I wished to create as the named range and the second column a formula that would be its values, the selection would create multiple named ranges in one go via VBA. rather than creating them 1 at a time
A1= axisx B1=Offset($d$1,0,0,$c$1,1)
A2= axisy1 B2=Offset($e$1,0,$d$2,$d$1,1)
A3= axisy2 B3=Offset($d$1,0,Sd$3,$e$1,1)
so selecting A1:b3 and running the vba code would generate 3 named ranges
axisx which refers to Offset($d$1,0,0,$c$1,1)
axisy1 which refers to Offset($d$1,0,0,$dc$1,1)
axisy2 which refers to Offset($d$1,0,0,$e$1,1)
however the code would work for any 2 column selection
thanks for any assistance that can be given
Bookmarks