Conditional formatting based on different cells

HappyChappy

Active Member
Joined
Jan 26, 2013
Messages
378
Office Version
  1. 2019
  2. 2010
  3. 2007
Platform
  1. Windows
Hi is it possible to have a range of cells a1:a50 with data in and if any of these cells are blank then a conditional format applied to cells d1:d50

so if a7 is blank then d7 would show "Holiday" in it otherwise nothing happens.

thanks in advance
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
If you want formula try this at D1:
Excel Formula:
If(A1="",Holiday","")
And drag it down

If want Macro:
VBA Code:
Sub ConditionalValue()
Dim Lr As Long, i As Long
Lr = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To Lr
If Cells(i, 1).Value = "" Then
Cells(i, 4).Value = "Holiday"
End If
Next i

End Sub
 
Upvote 0
Solution
If you want formula try this at D1:
Excel Formula:
If(A1="",Holiday","")
And drag it down

If want Macro:
VBA Code:
Sub ConditionalValue()
Dim Lr As Long, i As Long
Lr = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To Lr
If Cells(i, 1).Value = "" Then
Cells(i, 4).Value = "Holiday"
End If
Next i

End Sub
Thank you for the help
 
Upvote 0
Thank you for the help
Just for the record: If either suggestion (or both) by maabadi does what you want then your title & first post are quite misleading as neither suggestion has anything to do with conditional formatting. :)
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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