Automatic Return When Choosing Drop Down Menu Sleection

L

lean cost man

I have code set up such that when a cell with a drop down menu is chosen, the
screen view increases to 120% (so the drop down list is easier to read).
Once the selection in the menu is made, you can click any other cell and the
screen view returns to the original zoom value and a specific cell, A1.
Rather than an extra key stroke of clicking another cell, I would like to to
have the screen view zoom and cursor location all happen when the drop down
menu selection is made. I appreciate any feedback as to how to accomplish
this.
 
J

JR Form

lean cost man,

Is the drop down menu a combo box or is it the validation drop down box?
 
J

JR Form

LCM,

Try this code for a solution. Set up a new combo box and name it combobox1
then put this code behind it.

'**********************************
Private Sub ComboBox1_Change()
ZoomMe (100)
ActiveSheet.Range("A1").Select
End Sub

Private Sub ComboBox1_DropButtonClick()
If ComboBox1.ListCount > 0 Then
Exit Sub
Else
ComboBox1.AddItem "120"
ComboBox1.AddItem "130"
ComboBox1.AddItem "140"
ComboBox1.AddItem "150"
End If
End Sub

Private Sub ComboBox1_GotFocus()
ZoomMe (200)
End Sub

Add this to a module-
'**************************
Function ZoomMe(Val1 As Integer)
ActiveWindow.Zoom = Val1
End Function
'**************************
 

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

Top