I've made a code in Macros that only works for one particular spreadsheet. I'm not sure how to loop it or set it to where is does the same thing to the other 20 or so sheets(all in the same workbook) that I have. Also if it matters the code is only for a particular column as well, e.g. columns O and P(it's the same for all 20 sheets).
TestCase #1
Range("S2").Value = "1. " & Range("J2").Value & vbNewLine & vbNewLine & "2. " & Range("J3").Value & vbNewLine & vbNewLine & "3. " & Range("J4").Value & vbNewLine & vbNewLine & "4. " & Range("J5")
Range("T2").Value = "1. " & Range("K2").Value & vbNewLine & vbNewLine & "2. " & Range("K3").Value & vbNewLine & vbNewLine & "3. " & Range("K4").Value & vbNewLine & vbNewLine & "4. " & Range("K5")
So for the code above it varies between different sheets(this is the code that i need to loop for all 20 sheets) TestCase1 or Sheet1 has 5 rows, but the others varies to maybe up the the hundreds. I would like to know how can i integrate a count and loop for it.
' TestCase #1
Sheets(2).Select
Range("S2").Copy
Sheets(1).Select
Range("O2").Select
ActiveSheet.Paste
Sheets(2).Select
Range("T2").Copy
Sheets(1).Select
Range("P2").Select
ActiveSheet.Paste
For the second code I would like to loop it so it just copies the previous information that has been concatenated on to my other worksheet. Thanks in advance anyone :)