Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Window zoom
Hi all,
I found a bit of code that fits a certain number of columns to fit to the excel window however my columns 'B' threw to 'E' and its only 'A' and 'F' is meant to fit to to the rest of the window and my other difficulty is that the zoom factor is not always 100, below is my first attempt if anyone can help me on where I might be going wrong. My Code Setwidth = Worbooks("myWorkbook.xls").Sheets("Sheet1").Column s _("B:B").Columnwidth Setwidth = Setwidth + Worbooks("myWorkbook.xls").Sheets("Sheet1").Column s _("C:C").Columnwidth Setwidth = Setwidth + Worbooks("myWorkbook.xls").Sheets("Sheet1").Column s _("D:D").Columnwidth Setwidth = Setwidth + Worbooks("myWorkbook.xls").Sheets("Sheet1").Column s _("E:E").Columnwidth Totalwidth = ActiveWindow.Useablewidth Factor = Worbooks("myWorkbook.xls").Sheets("Sheet1").Column s("B:B").width / _ Worbooks("myWorkbook.xls").Sheets("Sheet1").Column s("B:B").columnwidth _ WindowWidth = ((Totalwidth / Factor) * (((100 - ActiveWindow.Zoom) / 100) + 1)) - (Setwidth * (((100 - ActiveWindow.Zoom) / 100) + 1)) SideWidth = (WindowWidth) / 2 Workbooks("MyWorkbook.xls").Sheets("Sheet1").Colum ns("A:A").ColumnWidth = _ SideWidth Workbooks("MyWorkbook.xls").Sheets("Sheet1").Colum ns("F:F").ColumnWidth = _ SideWidth Thanks in Advance Jason |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Please help! Print Preview Zoom is Grayed Out...Doesn't zoom. | Excel Discussion (Misc queries) | |||
Setting the zoom size of a new window from 100% to 75% | Excel Discussion (Misc queries) | |||
In Excel - how to delete new window created from window on tool ba | Excel Worksheet Functions | |||
Position Form on screen v Window Zoom ! | Excel Programming | |||
Excel Window Zoom Problems | Excel Programming |