TestLoop.xlsmI would like to use a variable with sheet codenames to loop through copying between pairs of worksheets, ex. codename B1 to codename P1, B2 to P2, etc. When distributed, users are likely to rename sheets. The following procedure works, but I have to repeat the formula for each loop. Have searched but could not find how to use a variable with the codename.
[VBA]Sub CtCreat()
Dim Ct As Long
Dim X As Long
'Determine number of sheets to work with
Ct = ThisWorkbook.Sheets("Start").Range("B1").Value
'Loop through varable number of sheets
'using Sheet codenames to copy
'B(X) will always copy to P(X)
For X = 1 To Ct
Select Case X
Case 1
P1.Range("A1").Value = B1.Range("A1").Value
Case 2
P2.Range("A1").Value = B2.Range("A1").Value
Case 3
P3.Range("A1").Value = B3.Range("A1").Value
Case 4
P4.Range("A1").Value = B4.Range("A1").Value
Case 5
P5.Range("A1").Value = B5.Range("A1").Value
End Select
Next X
End Sub[/VBA]
Welcome any suggestions
Jim