Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Tab Key reset | Excel Worksheet Functions | |||
set Print Preview to "preview" page that was being worked on? | Excel Discussion (Misc queries) | |||
How do I reset the tab key? | Excel Discussion (Misc queries) | |||
print preview v page break preview | Excel Discussion (Misc queries) | |||
set or reset the print range for several sheets at a time? | Excel Discussion (Misc queries) |