I would like to create named ranges in my Excel sheet which should be copied to another worksheet later.
I have created a code that names the ranges like this:
Sub Sample1()
Dim RangeName As String
RangeName1 = Worksheets("DB_Elements").Range("B3")
ThisWorkbook.Names.Add Name:=RangeName1, RefersTo:=Worksheets("DB_Elements").Range("B3:V14")
RangeName2 = Worksheets("DB_Elements").Range("B17")
ThisWorkbook.Names.Add Name:=RangeName2, RefersTo:=Worksheets("DB_Elements").Range("B17:V28")
However, this needs to be repeated another 85 times. So I need a loop in my VBA that would create each time a new named range based on the "B" cell value which is always offset 14 rows down. The named ranges always consist of 12 rows and 21 columns.