I don't know if this is the best way, but this is how I've done it in the past.
Use whatever variable names you want, I'll use N1 for the example. You will need to set your computer to military time for this to work BTW.
- Set variable N1 to the current hour.
- Repeat while N1 > 8.
...have your macro run and run again
...set N1 to current hour again at the end, but inside the end repeat.
- End Repeat
So, you would start the macro at 16:00, N1 would be 16. the next hour it would be 17. once it got to 1am, it would be set to 1, 2am = 2, all the way until N1 hits 8am = 8.
The macro would stop.
HTH