Good day Demigods,
I have the following code sitting in "ThisWorkbook":
Works great because i am only working on 'H'!AL3 at the moment, whilst i design the worksheet.
However, the range is going to change each time i copy the rows down.
I know what the range is going to be each time - the next one is 'H'!AL40, followed by 'H'!AL77 - a difference of plus 37 rows each time.
How can i adapt the above code to take this into consideration, to keep going an infinite number of times?
Any help/suggestions greatly appreciated, as always.
Enjoy your day
Best regards
manc
I have the following code sitting in "ThisWorkbook":
Code:
Sub Button_Goto_Correct_Consignee()
Dim BR As Integer
BR = Range("'H'!AL3")
Select Case BR
Case Is = 1: Application.GoTo (ActiveWorkbook.Sheets("MDZ_AD1").Range("A1"))
Case Is = 2: Application.GoTo (ActiveWorkbook.Sheets("MDZ_FH2").Range("A1"))
Case Is = 3: Application.GoTo (ActiveWorkbook.Sheets("MDZ_IF3").Range("A1"))
Case Is = 4: Application.GoTo (ActiveWorkbook.Sheets("MDZ_KFF4").Range("A1"))
Case Is = 5: Application.GoTo (ActiveWorkbook.Sheets("MDZ_OSBJ5").Range("A1"))
Case Is = 6: Application.GoTo (ActiveWorkbook.Sheets("MDZ_OSBD6").Range("A1"))
Case Is = 7: Application.GoTo (ActiveWorkbook.Sheets("MDZ_SM7").Range("A1"))
Case Is = 8: Application.GoTo (ActiveWorkbook.Sheets("MDZ_SA8").Range("A1"))
Case Is = 9: Application.GoTo (ActiveWorkbook.Sheets("MDZ_WS9").Range("A1"))
End Select
End Sub
Works great because i am only working on 'H'!AL3 at the moment, whilst i design the worksheet.
However, the range is going to change each time i copy the rows down.
I know what the range is going to be each time - the next one is 'H'!AL40, followed by 'H'!AL77 - a difference of plus 37 rows each time.
How can i adapt the above code to take this into consideration, to keep going an infinite number of times?
Any help/suggestions greatly appreciated, as always.
Enjoy your day
Best regards
manc