Question

I am creating a spreadsheet which will be uploaded to a database and there needs to be strict validation.

I need to ensure that if cell A2 has text in it, then cells C2,D2,F2,G2 must have data. I would like to do this with colour - if A2 has text then the other cells are highlighted red until they contain text, then the background colour changes back to white. (The cells listed are REQUIRED and must contain a value).

There will be about 1000+ rows in this spreadsheet and I have attempted this using the data validation but it would involve me going in row by row.

Was it helpful?

Solution

Data validation does not require you to do row by row, by default Excel seems to make it so (by fixing row and column with dollar signs), but that can be easily changed.

What you can do is create a formula in your conditional formatting for the top most row where you want this applied to, now get rid of the dollar signs in front of the row numbers in your formula and extend the range where this applies for to all the thousands of rows that you want it applied to.

formula in your case for C2 will be: =AND(LEN($A2)>0;LEN(C2)=0) this can be applied for C2:F2000 :

Applied to C2:F2000

Or what you can do is specify this formula for C1 (=AND(LEN($A1)>0;LEN(C1)=0) ) and apply it to C:F.

The condition formula when applying to complete columns Applied to C:F

No need for VBA.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top