Hello,
I am new to the VBA programming.I need to code which compares dates from column E with respective date in column F then highlight green if date is greater and Red if date is lower. The code should stop on empty rows.
Hello,
I am new to the VBA programming.I need to code which compares dates from column E with respective date in column F then highlight green if date is greater and Red if date is lower. The code should stop on empty rows.
Hi and welcome.
Is there a reason you're looking for VBA to do this rather than just use conditional formatting?
If this something you need to happen when you enter dates in a row, i.e. entering the date is the trigger? Or do you want to click a button when all the data is in and apply the highlight at that stage?
BSB
It might be useful if you attach a desensitized version of your workbook and include the macro you already have.
It's often easier to add to what you have than start from scratch only to have you come back and ask if we can combine the two for you.
To attach your workbook, click on "Go Advanced" below your reply then scroll down and click where it says "Manage Attachments" to open the upload window.
BSB
Hello, i am afraid I can’t share the sheet here. I don’t have access to excel outside work. I can use that only in office and can’t login to external sites from office.
If you could help me code these, I will combine myself. Basically, I want to understand how to name variable and write If loop here. Thanks in advance for your help.
Possibly...![]()
Please Login or Register to view this content.
Dangelor - Thank you so much, it seems working fine. Just one error, it is highlighting heading row as well, how to change it to skip headings. Also, Can you please help me understand what the below code does actually. Thanks in advance.
lRow = Cells(Rows.Count, 5).End(xlUp).Row
Set r = Range(Cells(1, 5), Cells(lRow, 5))
![]()
Please Login or Register to view this content.
This is perfect now, Thank you so much. I learnt how to end selection at last row and If statement.
To cut down on typing.
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.![]()
Please Login or Register to view this content.
Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks