This one you can try:
Public Sub MySheetHeadings()
With Application
.DisplayFullScreen = False
.DisplayFormulaBar = True
.CommandBars("Worksheet Menu Bar").Enabled = True
.CommandBars("Standard").Visible = True
.CommandBars("Formatting").Visible = True
.CommandBars("Drawing").Visible = True
End With
Dim oRange As Excel.Range
Dim RowCount As Long
' MySheetList is a named range where you can keep teh required worksheets
' name
Set oRange = ThisWorkbook.Names("MySheetList").RefersToRange
For RowCount = 1 To oRange.Rows.Count
If oRange.Cells(RowCount, 1).Value = "" Then
Exit For
Else
ThisWorkbook.Worksheets(oRange.Cells(RowCount, 1).Value).Activate
ActiveWindow.DisplayHeadings = True
End If
Next RowCount
End Sub
--
Malik
"Sandy" wrote:
> I have the following which loops through 19 Worksheets :-
>
> For Each Wksht In Worksheets
> With Application
> .DisplayFullScreen = False
> .DisplayFormulaBar = True
> .CommandBars("Worksheet Menu Bar").Enabled = True
> .CommandBars("Standard").Visible = True
> .CommandBars("Formatting").Visible = True
> .CommandBars("Drawing").Visible = True
> End With
> Next
>
> For Each Wksht In Worksheets
> Wksht.Activate
> ActiveWindow.DisplayHeadings = True
> Next
>
> however I only require it to loop through 7 sheets - say sheets "A" thro
> "G". How can I change the above to do that?
>
> Thanks
> Sandy
>
|