Macro to highlight a row if cells match value
Solved/Closed
Related:
- Macro to highlight row of selected cell
- Saints row 2 cheats - Guide
- Clear only the formatting from the selected cell (leaving the content) - Guide
- Can you make a close friends highlight - Instagram Forum
- How to take screenshot of selected area in excel - Guide
- Highlight cell if another cell contains text - Excel Forum
2 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Feb 22, 2011 at 09:45 AM
Feb 22, 2011 at 09:45 AM
Hi Sgriffis,
Try this code:
You stated that you are very new to VBA so here's how to implement the code:
In excel goto top menu > extra > macro > visual basic editor (or ALT F11).
A new window will open, goto top menu > insert > module.
Copy the code in the big white field.
Adjust the name "test" to whatever name you want to give this macro.
Adjust the range ("E1:E100") to whatever range you use in your file.
You can now close the visual basic editor window.
Back at excel goto top menu > extra > macro > macro's (or ALT F8).
Choose to run the macro "test" or whatever name you changed it into.
Note: Actions made by macro cannot be undone using the blue arrows!
So it is always best to save before running a macro, if the desired result doesn't show up you can simply reload your file.
Best regards,
Trowa
Try this code:
Sub test() Set MR = Range("E1:E100") For Each cell In MR If cell.Value >= 50 And cell.Offset(0, 3).Value <= Date Then cell.EntireRow.Font.Bold = True Next End Sub
You stated that you are very new to VBA so here's how to implement the code:
In excel goto top menu > extra > macro > visual basic editor (or ALT F11).
A new window will open, goto top menu > insert > module.
Copy the code in the big white field.
Adjust the name "test" to whatever name you want to give this macro.
Adjust the range ("E1:E100") to whatever range you use in your file.
You can now close the visual basic editor window.
Back at excel goto top menu > extra > macro > macro's (or ALT F8).
Choose to run the macro "test" or whatever name you changed it into.
Note: Actions made by macro cannot be undone using the blue arrows!
So it is always best to save before running a macro, if the desired result doesn't show up you can simply reload your file.
Best regards,
Trowa