I have vba code that opens a sheet within a workbook and copies a certain range to the same sheet. code below, how do I create a loop, instead of copying the code over and over changing cell references. instead open sheet in B3 copy, open b4 copy etc until B27? I've looked around but it might be the search terms I'm using can't find a resolution so far,
Worksheets(Worksheets("Contents").Range("B3").Value).Activate
Range("B2").Select
to go to the next sheet I would manually change B3 to b4, how can I create a loop to do this for a defined Bx range?
full code being executed below
`Worksheets(Worksheets("Contents").Range("B3").Value).Activate
Range("B2").Select
Count rows in raw data
intRowsused = ActiveSheet.UsedRange.Rows.Count 'count rows used in the table
'Copy
Range("B3:T" & intRowsused).Copy
Sheets("Master Template").Select
Set rng = ActiveSheet.Range("A:T")
lastRow = rng.Find(What:="*", After:=rng.Cells(1), Lookat:=xlPart, LookIn:=xlFormulas, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False).Row
writeRow = lastRow + 1
Range("A" & writeRow).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False `
any help will be much appreciated. Thanks