ststern45
Well-known Member
- Joined
- Sep 17, 2005
- Messages
- 965
- Office Version
- 365
- 2010
- Platform
- Windows
Hello everyone,
I have a question about how to use VBA to format a cell based on another range of cells.
For example using the code at the very bottom is pretty close to what I was looking for but need the following:
I have a range of cell U3:FG145 that is either a blank cell or not blank (not blank cell(s) contain a letter and number such as F6)
The second range of data is located in cell range N20:N4219
So this is what I would like to accomplish:
1>Highlight the cells in range U3:FG145 that are blank code: > c.Interior.Color = RGB(0, 0, 0) 'Color Black
2>Highlight the cells in range U3:FG145 that contain the data from cell range N20:N4219 code: > c.Interior.Color = RGB(146, 208, 80) 'Color Light Green
Thanks in advance!!
For Each c In Range("U3:FG145").Cells
If c.Value = "" Then
c.Interior.Color = RGB(0, 0, 0) 'Color Black
Else
c.Interior.Color = xlNone
End If
Next c
I have a question about how to use VBA to format a cell based on another range of cells.
For example using the code at the very bottom is pretty close to what I was looking for but need the following:
I have a range of cell U3:FG145 that is either a blank cell or not blank (not blank cell(s) contain a letter and number such as F6)
The second range of data is located in cell range N20:N4219
So this is what I would like to accomplish:
1>Highlight the cells in range U3:FG145 that are blank code: > c.Interior.Color = RGB(0, 0, 0) 'Color Black
2>Highlight the cells in range U3:FG145 that contain the data from cell range N20:N4219 code: > c.Interior.Color = RGB(146, 208, 80) 'Color Light Green
Thanks in advance!!
For Each c In Range("U3:FG145").Cells
If c.Value = "" Then
c.Interior.Color = RGB(0, 0, 0) 'Color Black
Else
c.Interior.Color = xlNone
End If
Next c
Last edited: