Invalid Data in Validation Cells

SteveBC

New Member
Joined
Mar 8, 2013
Messages
21
I have created a product order form on Excel.
In cell A1 I can select a product from a validation list.
in cell A2 I can select from a choice of upholstery for that specific product from another validation list.
in cell A3 I can select from a choice of weights for that specific product from a further list.
Upholstery and weights can differ according to which product is selected.

Whilst I have written a macro to clear all data between orders I am worried that the person who places the orders might not clear the data and then select a different product which would potentially leave the previous upholstery and weight in the cells below creating an ‘illegal’ combination and an invalid order.
i discovered circle invalid data but it appears that is not an automatic function and it would need to be selected each time. Is there any way such an illegal combination would be automatically highlighted?

Any help appreciated.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Use a Worksheet_Change event macro to automatically clear the dependent dropdowns when a parent dropdown changes.

To install this code in the Worksheet's code module:

  • Right-click on the sheet tab
  • Select View Code from the pop-up context menu
  • Paste the code below in the sheet's code module

Code:
[COLOR=darkblue]Private[/COLOR] [COLOR=darkblue]Sub[/COLOR] Worksheet_Change([COLOR=darkblue]ByVal[/COLOR] Target [COLOR=darkblue]As[/COLOR] Range)
    [COLOR=darkblue]If[/COLOR] Target.Address(0, 0) = "A1" [COLOR=darkblue]Then[/COLOR]
        Range("A2:A3").ClearContents
    [COLOR=darkblue]ElseIf[/COLOR] Target.Address(0, 0) = "A2" [COLOR=darkblue]Then[/COLOR]
        Range("A3").ClearContents
    [COLOR=darkblue]End[/COLOR] [COLOR=darkblue]If[/COLOR]
End [COLOR=darkblue]Sub[/COLOR]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,485
Messages
6,113,931
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top