An Example of Looping Over Worksheets
- Get link
- X
- Other Apps
Imagine that (somewhat egotistically) you decide to name all of your worksheets in a workbook after your company name (for us it's Wise Owl).
Sub RenameWorksheets()
'a reference to each worksheet in the active workbook
Dim ws As Worksheet
'the index number to use
Dim SheetNumber As Integer
SheetNumber = 0
For Each ws In Worksheets
'for each worksheet, rename it
SheetNumber = SheetNumber + 1
ws.Name = "Wise Owl " & SheetNumber
Next ws
End Sub
- Get link
- X
- Other Apps
Comments
Post a Comment
jeetexceltips@gmail.com