For...Next Loop with Worksheet : Worksheets « Excel « VBA / Excel / Access / Word






For...Next Loop with Worksheet

 
     Sub FilePathInFooter()
         Dim i As Integer, sFilePath As String

         sFilePath = ActiveWorkbook.FullName
         For i = 1 To Worksheets.Count Step 1
             Worksheets(i).PageSetup.CenterFooter = sFilePath
         Next i
     End Sub

 








Related examples in the same category

1.Do... Loop Until Loops with Worksheets
2.Looping Through Worksheets in a Workbook
3.move the second worksheet to end of workbook
4.performs a simple bubble sort to sort the worksheets in the workbook
5.The Sheets Collection
6.Grouping Worksheets
7.Dynamic Arrays for worksheet name
8.Use for loop to loop through all worksheets
9.Sort all worksheets