chuckles1066
Banned
- Joined
- Dec 20, 2004
- Messages
- 372
Hi all,
I've tried to adapt something that I picked up here previously but to no avail.
I'll keep it simple, I think I'll be able to modify whatever solutions you guys are able to come up with.
So.....column A contains date, column B contains time and column C contains site ID.
Starting at the first row of data (row 2) format the row from columns A to C with a colour (say purple).
Now the fun begins......
For each subsequent row, the macro should
(a) check to see if the site ID matches the one above
(b) if it does, is the time in that row less than 2 hours from the row above
(c) if so, then the row needs to be coloured as the row above
(d) if not, or if the site ID doesn't match the one above, the macro needs to do nothing, move onto the next row and repeat the procedure
Any advice greatly appreciated as always.
(PS: if anyone's feeling especially brave, at some future point I'll have to build in something to determine the 2 hour thing when the date is different; e.g 23.00 hours on a Friday to 00.05 hours on a Saturday is less than 2 hours but my existing macro won't pick it up because if you subtract 23.00 from 00.05 the maths doesn't work).
I've tried to adapt something that I picked up here previously but to no avail.
I'll keep it simple, I think I'll be able to modify whatever solutions you guys are able to come up with.
So.....column A contains date, column B contains time and column C contains site ID.
Starting at the first row of data (row 2) format the row from columns A to C with a colour (say purple).
Now the fun begins......
For each subsequent row, the macro should
(a) check to see if the site ID matches the one above
(b) if it does, is the time in that row less than 2 hours from the row above
(c) if so, then the row needs to be coloured as the row above
(d) if not, or if the site ID doesn't match the one above, the macro needs to do nothing, move onto the next row and repeat the procedure
Any advice greatly appreciated as always.
(PS: if anyone's feeling especially brave, at some future point I'll have to build in something to determine the 2 hour thing when the date is different; e.g 23.00 hours on a Friday to 00.05 hours on a Saturday is less than 2 hours but my existing macro won't pick it up because if you subtract 23.00 from 00.05 the maths doesn't work).