excel - Loop Cells to check hours passed -
i trying find macro loop through column check hours compared current time. date/time entered cell via button on form , formatted mm/dd/yyyy hh:mm:ss , want run macro once every hour find cells in column older 6 hours , needs work if goes next day. tried 1 small piece of code found results incorrect.
for each rcell in rrng.cells if rcell < hour(now) - 6 msgbox rcell.address, rcell.value elseif rcell = "" exit sub else
the datetime values in excel stored decimal. have compare difference between cell's value , now
greater 6.0/24
for each rcell in rrng.cells if - rcell.value > (6.0/24) msgbox rcell.address, rcell.value elseif rcell = "" exit sub else ......
Comments
Post a Comment