fill first column of flex grid with 15 minute increments - how to loop through

I am going to pass two parameters to my fill loop routine - the first value is 800, which represents 8:00 , and is my starting time, and the second value, which which will represent my ending time, is going to be 1700, in military time.

I need to start with the first parameter and, adding 15 minute increments and go until I reach the ending parameter.

So my column in flex grid will look like this:

08:00
08:15
08:30
08:45
09:00

and so on to the ending parameter - which is 17:00.

Could someone put together a snippet of code on an easy way to do this - to fill each column, incrementing by 15 minutes from the start parameter to the end parameter.

Thanks in advance.


LVL 13
samic400Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FER_GCommented:
try the next code snippet and let us know if it is that you need...

Regards.
FerG
Saludos
--
Ing. Fernando D. Giletta
MP: 4035 CIEC
San Fco. Cba. Arg.

Private Sub llenarGrilla(iniTime As Date, endTime As Date, interval As Integer)
    Dim actTime As Date
    actTime = iniTime
    With grilla
        .Rows = 1
            
        Do Until actTime >= endTime
            .AddItem actTime
            actTime = DateAdd("n", interval, actTime)
        Loop
        
    End With
End Sub
 
Private Sub cmd1_Click()
    Call llenarGrilla("08:00:00", "17:00:00", 15)
End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
samic400Author Commented:
thank you - exactly what i was looking for.
0
FER_GCommented:
you're welcome, i'm glad to help you!

Regards.
FerG
Saludos
--
Ing. Fernando D. Giletta
MP: 4035 CIEC
San Fco. Cba. Arg.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.