Apply Bold to cell contents on certain condition

Dear Experts:

I got thousand of entries in Column D.

A macro should now perform the following action:

As soon as the macro hits a blank cell in Column D, the cell that is located right next to it on the same row, i.e. on Column E,  should get the property bold .

Thank you very much in advance.

I have attached a sample file for your convenience.

Regards, Andreas

Conditional-bold.xlsx
Andreas HermleTeam leaderAsked:
Who is Participating?
 
Rgonzo1971Connect With a Mentor Commented:
Hi,

Sub Bolding()

Set myRange = Range(Range("D1"), Range("D65000").End(xlUp))

For Each cell In myRange
    If cell.Text = "" Then
        cell.Offset(0, 1).Font.Bold = True
    End If
Next

End Sub

Open in new window


Regards
0
 
SteveConnect With a Mentor Commented:
Or apply conditional formatting:

Highlight column E
Conditional formatting > Based upon formula
Formula:
=$D1=""
Format to be bold.
Accept.

This will do it without macro code.
0
 
Andreas HermleTeam leaderAuthor Commented:
Dear both,

great job from both of you. Thank you very much for your professional help.

I really appreciate it.

Regards, Andreas
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.