![]() |
|
#1
|
|||
|
|||
![]()
The change of value in the linked cell does not fire the Worksheet_Change event.
You could use the Worksheet_SelectionChange event but the 3 drop downs would not hide and unhide when the drop down 3 changes A11 until the cursor gets moved into another cell. This could leave things in the wrong state for considerable time. I'd use the Worksheet_Calculate event. This requires making another cell somewhere on the sheet =A11 to make sure something gets calculated the instant the value in A11 changes. The Calculate event fires every time something, anything, on the sheet gets calculated so there is the potential that having this event do things could affect Excels performance in which case you could have the =A11 cell on a separate sheet with nothing else and move the code over to that sheet. Right click on the sheet tab your drop downs are on, select view code then paste this into the sheet module that appears. Code:
Private Sub Worksheet_Calculate() Dim ws As Worksheet Set ws = Sheets("Price Calculator") If Range("A11") < 2 Then ws.Shapes("Drop Down 11").Visible = False ws.Shapes("Drop Down 12").Visible = False ws.Shapes("Drop Down 13").Visible = False Else ws.Shapes("Drop Down 11").Visible = True ws.Shapes("Drop Down 12").Visible = True ws.Shapes("Drop Down 13").Visible = True End If End Sub |
#2
|
|||
|
|||
![]()
Thank you NoSparks!! Very helpful
Correct me if I'm wrong, my understanding of what you've said is: 1) Start a new worksheet in the same workbook, say its called "Backend" 2) Put a formula in a cell, say C1, and that formula should be = 'Price Calculator'!$A$11 3) Change your code where it says: If Range("A11") < 2 Then To If Range("C1") < 2 Then 4) Paste this code onto the "Beckend" worksheet, and NOT the "Price Calculator" worksheet If I have understood you correctly, what would the code call the combo boxes?? Would they not have to be referenced to the "Price Calculator" worksheet?? PS I have tried your code exactly as it is straight into the worksheet coding, and it works a treat but would still like the above guidance if poss!!!! |
![]() |
Tags |
combo box, combobox, vba macro |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to Hide/Un-hide a worksheet based on cell on another sheet. | easton11 | Excel Programming | 1 | 06-02-2015 12:07 PM |
Word 2010 Content Control help - Combo Boxes vs Drop Down List | proghy | Word | 1 | 09-16-2014 02:01 PM |
![]() |
DeborahBartlett | Word | 1 | 01-04-2014 11:06 AM |
![]() |
ubns | Excel Programming | 5 | 05-07-2012 05:44 AM |
![]() |
DrewB | Word | 3 | 06-08-2009 11:29 PM |