Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Algorithm based on time and date ( =Now() )
Hi All
I need to create an algorithm based on time and date i.e =now(), and have this in a vba macro, so i can run it via a button I've never done an algorithm before, so i dont know how to begin The macro part i should be able to do ok Can anyone suggest a way to build a basic algorithm, or point me towards a url Thanks in advance P |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Algorithm based on time and date ( =Now() )
An algorithm is a set of rules.
What do you want the algorithm to do??? -- Vasant "Phillip Torna." wrote in message ... Hi All, I need to create an algorithm based on time and date i.e =now(), and have this in a vba macro, so i can run it via a button. I've never done an algorithm before, so i dont know how to begin. The macro part i should be able to do ok. Can anyone suggest a way to build a basic algorithm, or point me towards a url? Thanks in advance. PT |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Algorithm based on time and date ( =Now() )
I need it to produce a 22 digit unique number. (though i may need to be produce either smaller or larger numbers depending on the current projects needs.
As time and date are unique, i though an algorithm based on time & date would be able to provide this Cheers PT |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Algorithm based on time and date ( =Now() )
You're limited to 15 digits with a floating point number,
so you will probably be wanting to construct a string with your unique ID. Dim UniqueID As String UniqueID="Q1234567" & Format(Date,"yyyymmdd") & Format (Time,"hhmmss") |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Algorithm based on time and date ( =Now() )
Thank's Brad
I'll be able to construct something using your below example and some existing code Thanks. Very much appreciated ----- Brad Yundt wrote: ---- You're limited to 15 digits with a floating point number, so you will probably be wanting to construct a string with your unique ID Dim UniqueID As Strin UniqueID="Q1234567" & Format(Date,"yyyymmdd") & Forma (Time,"hhmmss" |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Algorithm based on time and date ( =Now() )
"Phillip Torna" wrote...
I'll be able to construct something using your below example and some existing code. .... ----- Brad Yundt wrote: ----- .... UniqueID="Q1234567" & Format(Date,"yyyymmdd") & Format(Time,"hhmmss") If only one person would be using this, this would be OK. If multiple users could be using this at the same time, there's a nonnegligible chance your code could generate multiple instances of the exact same 'unique' key. There's only one reliable way to generate unique serial numbers: request them from a single, central source that keeps track of the last such value provided. No other approach is robust. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculate Date based on Time | Excel Worksheet Functions | |||
can a formula add color based on a date and time? | Excel Discussion (Misc queries) | |||
How can I monitor CPU time of algorithm I developed in Excel vba? | Excel Discussion (Misc queries) | |||
Looking up a value based on date and time, what's wrong? | Excel Worksheet Functions | |||
change date based on time | Excel Discussion (Misc queries) |