JasonEnsor
Programmer
Hi Guys,
I am building a userform to deal with creating a rota. What I am wanting to do is let the user select a start and end time from a dropdown list then when they click a button it will populate the worksheet as follows
Person 1 start time = 08:00 end time = 09:00
Person 2 start time = 08:00 end time = 10:00
Columns Headings (these are times)
_______|08:00 | 08:30 | 09:00 | 09:30 | 10:00 | 10:30
Person 1|A | A | | | |
Person 2|A | A | A | A | |
What I am wanting to do is loop through the people then populate the worksheet for each 30 min time increment between the start and end time. My issue is I am not sure of loop through the times in 30 increments
So for person 2 I would have a loop like
Does anyone out there have any tips on how to achieve the looping through the time?
Many Thanks in advance
J.
Regards
J.
I am building a userform to deal with creating a rota. What I am wanting to do is let the user select a start and end time from a dropdown list then when they click a button it will populate the worksheet as follows
Person 1 start time = 08:00 end time = 09:00
Person 2 start time = 08:00 end time = 10:00
Columns Headings (these are times)
_______|08:00 | 08:30 | 09:00 | 09:30 | 10:00 | 10:30
Person 1|A | A | | | |
Person 2|A | A | A | A | |
What I am wanting to do is loop through the people then populate the worksheet for each 30 min time increment between the start and end time. My issue is I am not sure of loop through the times in 30 increments
So for person 2 I would have a loop like
Code:
starttime = "08:00"
endtime = "10:00"
time = starttime
while time not equal to endtime
' do code here to populate the sheet etc...
time + 30mins
Loop
Does anyone out there have any tips on how to achieve the looping through the time?
Many Thanks in advance
J.
Regards
J.