I have 5 groups of 10 cells in an Excel worksheet. I want to do one thing if ALL 10 CELLS in one group are empty, or another thing if 1 or more of the cells of that same group are populated. So, lets say if all 10 cells are empty, I want to change the fill color of a rectangle (drawing) to white But, if any of those 10 cells has a value in it, then I want to change the fill color to "no fill". Make sense?
I've figured out a way of doing it by checking each cell and adding to an integer. But, it ends up being a lot of code since I have to do it 5 times.
Here's a quick sample of what I THOUGHT would work...
Sub Test
If Worksheets("WorksheetWithMyCells").Range("H16:H42").Value = "" Then (blah blah blah) ELSE (blah blah blah)
End If
End Sub
Thats the same code I used to check one cell, but when I put a range of cells it gives me a "Type Mismatch" error. Is there an easy way to do that without running a loop?
Thanks!
I've figured out a way of doing it by checking each cell and adding to an integer. But, it ends up being a lot of code since I have to do it 5 times.
Here's a quick sample of what I THOUGHT would work...
Sub Test
If Worksheets("WorksheetWithMyCells").Range("H16:H42").Value = "" Then (blah blah blah) ELSE (blah blah blah)
End If
End Sub
Thats the same code I used to check one cell, but when I put a range of cells it gives me a "Type Mismatch" error. Is there an easy way to do that without running a loop?
Thanks!