Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Far Far is offline
external usenet poster
 
Posts: 4
Default Using For Next to reset Pge Brk Preview on all sheets


I am trying to reset the following for each worksheet in
the workbook; however am getting errors on
the "Window.View = xlNormalView" (I am am trying to learn
the Object Model)Similar iss below w/ resetting pointer

Reset "Page Break Preview" for each worksheet in the
workbook; so view is set to "Normal" on each worksheet

Sub Set_Page_Preview_Normal()
For Each wks In Worksheets
Window.View = xlNormalView
Next wks
End Sub

' Reset Cell pointer in worksheet so view is at top of
page on each worksheet

Sub Set_Cell_Pointer_A1()
For Each wks In Worksheets
wks.Range("A1").Select
Next wks
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Using For Next to reset Pge Brk Preview on all sheets


There is no Worksheets collection, there is a Sheets collection

Sub Set_Page_Preview_Normal(
For Each sh In Sheet
Window.View = xlNormalVie
Next
End Su
----- Far wrote: ----


I am trying to reset the following for each worksheet in
the workbook; however am getting errors on
the "Window.View = xlNormalView" (I am am trying to learn
the Object Model)Similar iss below w/ resetting pointe

Reset "Page Break Preview" for each worksheet in the
workbook; so view is set to "Normal" on each workshee

Sub Set_Page_Preview_Normal(
For Each wks In Worksheet
Window.View = xlNormalVie
Next wk
End Su

' Reset Cell pointer in worksheet so view is at top of
page on each workshee

Sub Set_Cell_Pointer_A1(
For Each wks In Worksheet
wks.Range("A1").Selec
Next wk
End Su

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using For Next to reset Pge Brk Preview on all sheets

There is no Worksheets collection

This is completely incorrect.

There certainly is a worksheets collection.

--
Regards,
Tom Ogilvy



"chris" wrote in message
...

There is no Worksheets collection, there is a Sheets collection.

Sub Set_Page_Preview_Normal()
For Each sh In Sheets
Window.View = xlNormalView
Next
End Sub
----- Far wrote: -----


I am trying to reset the following for each worksheet in
the workbook; however am getting errors on
the "Window.View = xlNormalView" (I am am trying to learn
the Object Model)Similar iss below w/ resetting pointer

Reset "Page Break Preview" for each worksheet in the
workbook; so view is set to "Normal" on each worksheet

Sub Set_Page_Preview_Normal()
For Each wks In Worksheets
Window.View = xlNormalView
Next wks
End Sub

' Reset Cell pointer in worksheet so view is at top of
page on each worksheet

Sub Set_Cell_Pointer_A1()
For Each wks In Worksheets
wks.Range("A1").Select
Next wks
End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using For Next to reset Pge Brk Preview on all sheets

try this
Sub Set_Cell_Pointer_A1(
For Each Sh In Sheet
Sh.Selec
ActiveWindow.View = xlNormalVie
Nex
End Su


----- Far wrote: ----


I am trying to reset the following for each worksheet in
the workbook; however am getting errors on
the "Window.View = xlNormalView" (I am am trying to learn
the Object Model)Similar iss below w/ resetting pointe

Reset "Page Break Preview" for each worksheet in the
workbook; so view is set to "Normal" on each workshee

Sub Set_Page_Preview_Normal(
For Each wks In Worksheet
Window.View = xlNormalVie
Next wk
End Su

' Reset Cell pointer in worksheet so view is at top of
page on each workshee

Sub Set_Cell_Pointer_A1(
For Each wks In Worksheet
wks.Range("A1").Selec
Next wk
End Su

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Using For Next to reset Pge Brk Preview on all sheets

Hi,

1. Best practice is to declare your variables.
2. Worksheets belong to a workbook, in this instance "ActiveWorkbook"
3. To change the view of a worksheet it must be selected.
4. The View property belongs to the window in which the sheet is viewed.
5. To select a particular cell on each sheet, the sheet should be the active
one.


Sub Set_Page_Preview_Normal()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Select
ActiveWindow.View = xlNormalView
Next wks


End Sub

Sub Set_Cell_Pointer_A1()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Select
Range("A1").Select
Next wks
End Sub



Regards

Paul


"Far" wrote in message
...

I am trying to reset the following for each worksheet in
the workbook; however am getting errors on
the "Window.View = xlNormalView" (I am am trying to learn
the Object Model)Similar iss below w/ resetting pointer

Reset "Page Break Preview" for each worksheet in the
workbook; so view is set to "Normal" on each worksheet

Sub Set_Page_Preview_Normal()
For Each wks In Worksheets
Window.View = xlNormalView
Next wks
End Sub

' Reset Cell pointer in worksheet so view is at top of
page on each worksheet

Sub Set_Cell_Pointer_A1()
For Each wks In Worksheets
wks.Range("A1").Select
Next wks
End Sub





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tab Key reset DKSteph Excel Worksheet Functions 2 March 20th 09 07:20 PM
set Print Preview to "preview" page that was being worked on? ACULAK Excel Discussion (Misc queries) 0 October 5th 07 02:06 AM
How do I reset the tab key? Saeanen Excel Discussion (Misc queries) 2 May 22nd 07 04:26 PM
print preview v page break preview SamB Excel Discussion (Misc queries) 0 November 16th 06 05:09 PM
set or reset the print range for several sheets at a time? Mestrella31 Excel Discussion (Misc queries) 2 January 10th 05 09:07 PM


All times are GMT +1. The time now is 08:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"