Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default 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
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
Please help! Print Preview Zoom is Grayed Out...Doesn't zoom. PK Excel Discussion (Misc queries) 0 July 20th 09 03:33 PM
Setting the zoom size of a new window from 100% to 75% MongoMan Excel Discussion (Misc queries) 0 June 18th 08 11:30 PM
In Excel - how to delete new window created from window on tool ba Doug Excel Worksheet Functions 1 April 20th 06 09:22 PM
Position Form on screen v Window Zoom ! RAFAAJ2000[_2_] Excel Programming 3 July 19th 05 09:13 AM
Excel Window Zoom Problems Jim Rech Excel Programming 0 October 4th 04 10:56 PM


All times are GMT +1. The time now is 05:29 AM.

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

About Us

"It's about Microsoft Excel"