Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop to time in 24 hours format
Hi
I want to make a loop in time format like from 9:00 to 16:00 and with every half hour like 9:00 - 9:30 - -10:00 - 10:30 can i do that ? Regards alvin |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop to time in 24 hours format
Hi Alvin,
Could do that very easily manually - A1: 09:00 A2: 10:00 select A1:A2 grab the little handle and drag down to A14 B2: =TEXT(A1,"hh.mm -") & TEXT(A2,"hh.mm") double click the handle to fill down maybe you prefer "h.mm" format Or do you particularly need a VBA solution? Regards, Peter T "Alvin Hansen" wrote in message ... Hi I want to make a loop in time format like from 9:00 to 16:00 and with every half hour like 9:00 - 9:30 - -10:00 - 10:30 can i do that ? Regards alvin |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop to time in 24 hours format
Alvin Hansen wrote:
Hi I want to make a loop in time format like from 9:00 to 16:00 and with every half hour like 9:00 - 9:30 - -10:00 - 10:30 can i do that ? Regards alvin Make a sub in ThisWorkbook with: Private Sub Workbook_Open() Application.OnTime Now + TimeValue("00:30:00"), "RunThisSub" End Sub Create a module with: Public dTime As Date Sub RunThisSub() dTime = Now + TimeValue("00:30:00") Application.OnTime dTime, "RunThisSub" If Time < "09:00:00" or Time "16:00:00" then exit sub 'Put your code here End Sub This wil run every half hour but wil exit if not between 9 and 16 hours |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop to time in 24 hours format
You mean something like this:
Sub Tester1() Dim i As Single For i = #9:00:00 AM# To #4:00:00 PM# Step #12:30:00 AM# Debug.Print Format(i, "hh:mm:ss") Next End Sub -- Regards, Tom Ogilvy "Alvin Hansen" wrote in message ... Hi I want to make a loop in time format like from 9:00 to 16:00 and with every half hour like 9:00 - 9:30 - -10:00 - 10:30 can i do that ? Regards alvin |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop to time in 24 hours format
Seeing Warzel's adjacent post, I realize I completely misunderstood the
question. Ignore my suggestion. Peter T "Peter T" <peter_t@discussions wrote in message ... Hi Alvin, Could do that very easily manually - A1: 09:00 A2: 10:00 select A1:A2 grab the little handle and drag down to A14 B2: =TEXT(A1,"hh.mm -") & TEXT(A2,"hh.mm") double click the handle to fill down maybe you prefer "h.mm" format Or do you particularly need a VBA solution? Regards, Peter T "Alvin Hansen" wrote in message ... Hi I want to make a loop in time format like from 9:00 to 16:00 and with every half hour like 9:00 - 9:30 - -10:00 - 10:30 can i do that ? Regards alvin |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop to time in 24 hours format
Thanks again for the help
alvin "Tom Ogilvy" skrev: You mean something like this: Sub Tester1() Dim i As Single For i = #9:00:00 AM# To #4:00:00 PM# Step #12:30:00 AM# Debug.Print Format(i, "hh:mm:ss") Next End Sub -- Regards, Tom Ogilvy "Alvin Hansen" wrote in message ... Hi I want to make a loop in time format like from 9:00 to 16:00 and with every half hour like 9:00 - 9:30 - -10:00 - 10:30 can i do that ? Regards alvin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding time in 24 hour format to produce hours in decimal format | Excel Worksheet Functions | |||
+24 hours time format | New Users to Excel | |||
HOW TO CONVERT TIME FORMAT IN HOURS TO MINUTES | Excel Worksheet Functions | |||
Convert hours and minutes in time format into fractions of hours.. | Excel Worksheet Functions | |||
time format multiplied by hours worked ? | Excel Worksheet Functions |