Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 733
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate Date based on Time Mayte Excel Worksheet Functions 6 June 5th 08 09:07 PM
can a formula add color based on a date and time? Outbacker Excel Discussion (Misc queries) 1 August 29th 06 04:14 PM
How can I monitor CPU time of algorithm I developed in Excel vba? Jerry Excel Discussion (Misc queries) 2 August 27th 06 08:22 AM
Looking up a value based on date and time, what's wrong? Margo Guda Excel Worksheet Functions 3 February 28th 06 02:18 PM
change date based on time kdp145 Excel Discussion (Misc queries) 7 December 14th 05 02:05 AM


All times are GMT +1. The time now is 12:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"