insert every time value 15 minutes in array

Posted on 2006-04-21
Medium Priority
Last Modified: 2010-08-05

Please kindly assist how can we insert every 15 minutes into an array?


Arr_TimeValuesPer15=00:00 AM,00:15 AM,00:30 AM,00:45 AM,01:00 AM,01:15 AM,01:30 AM,......11:45 PM

Dim Arr_TimeValuesPer15() as string
redim preserve Arr_TimeValuesPer15(ubound(Arr_TimeValuesPer15)+95)

for i=0 to ubound(Arr_TimeValuesPer15)
next i

Question by:RyanBank
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 2000 total points
ID: 16505322
Dim Arr_TimeValuesPer15() as string
dim d as date
redim preserve Arr_TimeValuesPer15(ubound(Arr_TimeValuesPer15)+95)

d = 0
for i=0 to ubound(Arr_TimeValuesPer15)
  d= dateadd("n", 15)
next i

Author Comment

ID: 16505514
Thanks worked like a charm!

Dim Arr_TimeValuesPer15() As String
Dim d As Date
ReDim Preserve Arr_TimeValuesPer15(95)

d = 0
For i = 0 To UBound(Arr_TimeValuesPer15)
  Arr_TimeValuesPer15(i) = Format(d, "hh:mmAM/PM")
  d = DateAdd("n", 15, d)
Next i

Debug.Print Join(Arr_TimeValuesPer15, ",")


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question