View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default need some help with selecting a sheet in a loop again

Hi Gary,

Try something like:

Sub TestIt()
Dim c As Long
Dim sh As Worksheet
For c = 3 To ActiveWorkbook.Sheets.Count
For Each sh In ActiveWorkbook.Worksheets
If sh.CodeName = "Sheet" & c Then
'do something. e.g.:
MsgBox sh.Name
End If
Next sh
Next c

End Sub

---
Regards,
Norman



"Gary Keramidas" wrote in message
...
i have tabs renamed, so i am using this

For c = 2 To 13

Sheet2.Range("C5:E5").Copy
Range("C5:E5").PasteSpecial xlPasteValues, xlPasteSpecialOperationAdd '
(this range is on sheet1)
Next c


i want to replace the 2 with the c so it selects the range of sheets from
2 to 13.


any help appreciated
--


Gary