View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jason Sands Jason Sands is offline
external usenet poster
 
Posts: 3
Default Topic did not show up?

Works great!
For those wondering how to UDF:
http://office.microsoft.com/en-us/as...548461033.aspx

Jason

Bob Phillips wrote:
Here's a UDF

Function RandIt()
Dim tmp
Dim randvals(1 To 3) As Long
Dim i As Long

tmp = Application.UserName & " - " & Format(Date, "dd mmm yyyy") & " - "
Randomize
For i = 1 To 8
randvals(1) = Int((57 - 48 + 1) * Rnd + 48)
randvals(2) = Int((90 - 65 + 1) * Rnd + 65)
randvals(3) = Int((121 - 97 + 1) * Rnd + 97)

tmp = tmp & Chr(randvals(Int((Rnd() * 3) + 1)))
Next i

RandIt = tmp
End Function


in the worksheet

=RandIt()

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jason Sands" wrote in message
ups.com...
I posted a topic yesterday but it has yet to show up and no longer have
those notes... so bear with me.


I am wanting to have inside a cell:
REV: username - now() random-8-characters

I would want it to look something like
REV: Jason Sands - 28 Nov 2006 - y3V6Bk4A

I had a lot more detailed message yesterday but I think GMail lost it...