Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
change zoom based on column width | Excel Discussion (Misc queries) | |||
Change Zoom Value of Window with ComboBox in Custom Menu Control | Excel Programming | |||
How do I change the width of data columns in a column chart? | Charts and Charting in Excel | |||
Set Column Width Based On Total Width Of Other Columns | Excel Programming |