How to iterate through sheets and set ActiveWindow

  • Thread starter Thread starter gimme_this_gimme_that
  • Start date Start date
G

gimme_this_gimme_that

Hi,

How do you iterate through the sheets in a weekbook and set each sheet
to the ActiveWindow?

(I need to assign the scrollrow for each sheet.)

Thanks.
 
For Each Sheet In Sheets
MsgBox Sheet.Name
' your code here
Next 'Sheet

Regards

Trevor
 
Hello There, Try this code in the Workbook_Open event, Should fix you
right up...

enjoy, Rick


Private Sub Workbook_Open()
Dim wsk As Worksheet

Application.ScreenUpdating = False

For Each wsk In Worksheets
If wsk.Name <> "Test " Then
wsk.Select
wsk.ScrollArea = "a1:n31" '' << Change Range here
With ActiveWindow
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
End With
End If
Next wsk


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top