Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Macro to change column width and active window zoom as columns areselected

Using Excel 2003, I want to be able to:
1. go from column to column and have the width change as specified.
2. Have the zoom increase as specified in cells c27 (normal % zoom)
and c 28 (zoomed % zoom).
3. Limit these functions to rows 14, so if the active row becomes
<14, the zoom and the column width returns to normal.
I have worked with the following code, but the zoom does not seem to
work. I would appreciate any help in solving this problem.

Thanks,

Tonso

If Target.Column = 7 Then
Target.Columns.ColumnWidth = 20
ActiveWindow.Zoom = Sheets("Notes").Range("c28") 'c28 = 100
Else
Columns(7).ColumnWidth = 3.33
ActiveWindow.Zoom = Sheets("Notes").Range("c27") 'c27 = 80
End If
If Target.Column = 8 Then
Target.Columns.ColumnWidth = 34
ActiveWindow.Zoom = Sheets("Notes").Range("c28")
Else
Columns(8).ColumnWidth = 3.33
'ActiveWindow.Zoom = Sheets("Notes").Range("c27")
End If
If Target.Column = 9 Then
Target.Columns.ColumnWidth = 20
ActiveWindow.Zoom = Sheets("Notes").Range("c28")
Else
Columns(9).ColumnWidth = 3.33
'ActiveWindow.Zoom = Sheets("Notes").Range("c27")
End If
If Target.Column = 10 Then
Target.Columns.ColumnWidth = 20
ActiveWindow.Zoom = Sheets("Notes").Range("c28")
Else
Columns(10).ColumnWidth = 3.33
'ActiveWindow.Zoom = Sheets("Notes").Range("c27")
End If
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
change zoom based on column width michalaw Excel Discussion (Misc queries) 2 August 11th 09 09:37 PM
Change Zoom Value of Window with ComboBox in Custom Menu Control RyanH Excel Programming 0 October 17th 08 01:16 AM
How do I change the width of data columns in a column chart? Diana Charts and Charting in Excel 4 September 5th 07 05:26 PM
Set Column Width Based On Total Width Of Other Columns rayneraingoaway Excel Programming 1 June 28th 06 11:10 PM


All times are GMT +1. The time now is 06:18 PM.

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"