I will be very impressed if any of you experts can crack this code!

sbrazil

New Member
Joined
Nov 23, 2009
Messages
30
Hi,

I was wandering if someone could help me with codes.

I want to install a code which will enable me to widen the data validation dropdown menu temporarily to 80, but also have a zoom in to 130. I want it so it widens and zooms when I click on the dropdown menu, but then goes back to it's normal size once I click elsewhere.


I would be very, very impressed if someone could crack this one.

Thankyou,
speak again soon,
Scott <!-- / message -->
<!-- / message -->
 

Some videos you may like

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

sbrazil

New Member
Joined
Nov 23, 2009
Messages
30
Hi smitty,
Wow that was a quick response!

That is the exact page I found and realised it can be done. But I don't understand - This is two seperate codes, so how do I enter them?

Do I need two seperate windows, or both in one window?

Or one code which does both things?

Thanks,
Scott
 

Weaver

Well-known Member
Joined
Sep 10, 2008
Messages
5,196
You could combine them like this:

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
   If Target.Address(0,0) = "A1" Then
       Target.Columns.ColumnWidth = 80
       ActiveWindow.Zoom = 130
   Else
       Columns(1).ColumnWidth = 8.5
       ActiveWindow.Zoom = 100
   End If
End Sub
Which works if your validation range is in cell A1.
HTH
 

sbrazil

New Member
Joined
Nov 23, 2009
Messages
30
Weaver,
your a legend! You have come the closest to getting it for me so far!!!!!!!!!

I just tried it and it worked for A1.

But, how do I make it so it is for all data validation dropdown menus on the page?

Almost there, would appreciate your extra bit of help on this one.

Thanks,
Scott
 

sbrazil

New Member
Joined
Nov 23, 2009
Messages
30
Weaver,

Pleasebe sure to read my other post above, but basically, yes this is working, but I want it to work on all data validation cells on the page, and I want those cells to go back to their original size once i click on non-data validation cells.

does this make sense?

I have tried combining your macros and changing slightly, but it is beyond my knowledge sorry.

Thanks mate,
Scott
 

sbrazil

New Member
Joined
Nov 23, 2009
Messages
30
Hi Weaver - great thanks mate, but how do I make it work for all of the data validated cells on the page?

Any ideas?

Very impressed that you are able to do this for me so far - honestly!

Thanks mate,
Scott
 

Watch MrExcel Video

Forum statistics

Threads
1,090,249
Messages
5,413,305
Members
403,474
Latest member
Rampestamper

This Week's Hot Topics

Top