ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   FOR EACH (https://www.excelbanter.com/excel-programming/284014-each.html)

GREGORY

FOR EACH
 
hello

i would like to loop some code for sheets 3 to 17 of a
workbook, but I'm not really sure of the syntax? Any ideas?


Chip Pearson

FOR EACH
 
Greg,

Try something like

Dim Ndx As Long
Dim WS As Worksheet
For Ndx = 3 To 17
Set WS = Worksheets(Ndx)
' do something with WS
Next Ndx

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"GREGORY" wrote in message
...
hello

i would like to loop some code for sheets 3 to 17 of a
workbook, but I'm not really sure of the syntax? Any ideas?





All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com