Help writing Worksheet Loops (Limited number)

hellfire45

Active Member
Joined
Jun 7, 2014
Messages
445
I want to write a loop that will allow me to run some major formatting on a series of worksheets. This book has like 45 worksheets in it and I only need the loop to hit sheets 2 through 11 (that is the numeric order of the sheets from left to right).

Any suggestions about how to hit these sheets without activating every sheet and retyping all the lines of code?

thank you so much!
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try like this

Code:
Dim i As Long
For i = 2 To 11
    With worksheets(i)
    'your code here
    End With
Next i
 

Watch MrExcel Video

Forum statistics

Threads
1,108,512
Messages
5,523,323
Members
409,511
Latest member
hitesh222002

This Week's Hot Topics

Top