Change Zoom Value of Window with ComboBox in Custom Menu Control

R

RyanH

I have a custom menu tab that contains a submenu item which contains 2
comboboxes. The combobox will change the view of several sheets when the
combobox is changed.

1.) How do I set the zoom value of all the sheets with the combobox? If
there is a better way than what I have, please let me know!

Public Sub ChangeDeptViews()

SubName = "ChangeDeptViews"

' make sure Global Schedule is the active sheet
If Not IsGlobalAvailable() Then
Exit Sub
End If

Application.ScreenUpdating = False

' store current sheet
Set wksCurrentSheet = ActiveSheet

Sheets(Array("Engineering", "Graph Prod", "Metal Fab", "Alum Ext", _
"Custom Fab", "Electrical", "Ch Ltrs", "Foam Fab", _
"Metal Paint", "Thermo", "Tri Graphics", "Deco Faces", _
"Tri-Face", "LED", "Crating", "Service",
"Delivery")).Select
Sheets("Engineering").Activate
ActiveWindow.Zoom = CommandBars(1).Controls("Depts. View").Value

' restore sheet that was active
wksCurrentSheet.Activate
Application.ScreenUpdating = False

End Sub


2.) I would also like to change the width of the combobox because it will
only be holding percentages: 100%, 90%, 80%, etc? I have tried this and it
doesn't work.

' Global Schedule View Sub Menu
Set SubMenuItem = MenuItem.Controls.Add(Type:=msoControlComboBox)
With SubMenuItem
.Caption = "Global View"
.OnAction = "OnAction2003Calls"
.Tag = "combo1"
.Width = 10
.AddItem "80%"
.AddItem "90%"
.AddItem "100%"
.AddItem "110%"
.AddItem "120%"
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top