i need a macro code to compare time in two cells cell A and cell b
i need a macro code to compare time in two cells cell A and cell b
kshitij_dch,
I'm not exactly sure what you're looking for, but this should get you started:
![]()
Please Login or Register to view this content.
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
i have to compare cell A time with cell B time suppose cell a time is 13:00 and cell b tome is 12:57 , above situation is ok C1 gets green color else red
kshitij_dch,
What you're looking for can be accomplished with conditional formatting. Attached is an example workbook showing how it works. The conditional format formulas applied to column C are:
Atime is less than Btime, highlight column C as red:
=AND(COUNT($A1:$B1)=2,MOD($A1,1)<MOD($B1,1))
Atime is greater than Btime, highlight column C as green:
=AND(COUNT($A1:$B1)=2,MOD($A1,1)>MOD($B1,1))
Kshitij,
You have opened the same thread 7 times and this is duplication of efforts. If you need help and you are not receiving the responses, you can bump the same thread for a response. Do not create multiple threads for the same issue.
The next time such a thing happens, you will get another infraction.
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
hi thanks for the reply , is this possible to do with macro ???
Kshitij,
You have already received some replies. Please check them and let us know if its working for you.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks