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.
 

Some videos you may like

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

AlphaFrog

MrExcel MVP
Joined
Sep 2, 2009
Messages
16,213
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:

Forum statistics

Threads
1,089,615
Messages
5,409,341
Members
403,259
Latest member
Bubba49

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top