I used to have some code that would convert a 2 column selection into named range. I have changed jobs and no longer have access to it

for example if I had selected a1:b3 and it contained the names I wanted to create in column A, and what they reference in column B
Xaxis, =OFFSET($AC12,0,0,1,$Z$10)
Yaxis1, =OFFSET($AC13,0,0,1,$Z$10)
Yaxis2,=OFFSET($AC14,0,0,1,$Z$10)

by running the code it would create 3 named ranges

Can anybody help me to recreate it?

Thanks for your asssitance