Hello i have the following VBA code:
Sub Print_area()
Range("B2:U42").Select
ActiveWorkbook.Names.Add Name:="LL_1K", RefersToR1C1:="=LLBA!R2C2:R42C21"
Range("W2:AP42").Select
ActiveWorkbook.Names.Add Name:="LL_1B", RefersToR1C1:="=LLBA!R2C23:R42C42"
Range("B44:U84").Select
ActiveWorkbook.Names.Add Name:="LL_2K", RefersToR1C1:="=LLBA!R44C2:R84C21"
Range("W44:AP84").Select
ActiveWorkbook.Names.Add Name:="LL_2B", RefersToR1C1:="=LLBA!R44C23:R84C42"
End Sub
What i want to do is i want to create a loop (i suppose) to complete the task above a number of times.
So lets say that i want to loop through i=1:X
Then the name LL_1B, is LL_iB,
The range needs to be upped 42 for each loop so Range("B(2+(i-1)*42) : U(42+(i-1)*42) ")
etc
How do i write this in code that VBA understand?
Bookmarks