I have the below code:
Sub DYNRNGNAME()
Sheets("Sheet2").Select
Range("A1", Range("A65536").End(xlUp)).Select
Selection.CreateNames Top:=True
Range("b1", Range("b65536").End(xlUp)).Select
Selection.CreateNames Top:=True
Range("c1", Range("c65536").End(xlUp)).Select
Selection.CreateNames Top:=True
Range("d1", Range("d65536").End(xlUp)).Select
Selection.CreateNames Top:=True
Range("e1", Range("e65536").End(xlUp)).Select
Selection.CreateNames Top:=True
Range("F1", Range("F65536").End(xlUp)).Select
Selection.CreateNames Top:=True
End Sub
With this code I can create names which Sheet2 From A column To F column one by one.
A:F columns and its rows are dynamic.Sometimes column goes to M or N some times back to D or E.
And at the same time For each column there are differrent rows number.(Ex. A column has 5 rows, B 3 rows, C 18 rows... and so on)
How can I modify the code, for all columns which exist in Sheet2 and differrent rows ?
I thought" for next" , "with range" or "loop" statements, but couldn't find a way.
Thanks in advance for any reply and help.
Best regards,
turist
Bookmarks