Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / October 2006

Tip: Looking for answers? Try searching our database.

Topic did not show up?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jason Sands - 28 Oct 2006 07:22 GMT
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...
Bob Phillips - 28 Oct 2006 10:25 GMT
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()

Signature

HTH

Bob Phillips

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

> I posted a topic yesterday but it has yet to show up and no longer have
> those notes... so  bear with me.
[quoted text clipped - 6 lines]
>
> I had a lot more detailed message yesterday but I think GMail lost it...
Jason Sands - 28 Oct 2006 19:19 GMT
Works great!
For those wondering how to UDF:
http://office.microsoft.com/en-us/assistance/HA010548461033.aspx

Jason

> Here's a UDF
>
[quoted text clipped - 37 lines]
> >
> > I had a lot more detailed message yesterday but I think GMail lost it...
Jon von der Heyden - 28 Oct 2006 10:40 GMT
Hi.

Try: =A1&" - "&TEXT(TODAY(),"dd mmm yy")&"
"&MID(ADDRESS(1,RANDBETWEEN(1,26)),2,1)&RANDBETWEEN(0,9)&MID(ADDRESS(1,RANDBETWEEN(1,26)),2,1)&RANDBETWEEN(0,9)&MID(ADDRESS(1,RANDBETWEEN(1,26)),2,1)&RANDBETWEEN(0,9)&MID(ADDRESS(1,RANDBETWEEN(1,26)),2,1)&RANDBETWEEN(0,9)

Where A1 houses the user name.  You need to install Analysis Toolpa
for RANDBETWEEN() to work. Tools->Addins->Analysis Toolpak.

HTH

Regards,
Jon von der Heyde

--
Jon von der Heyde

Posted from - http://www.officehelp.i
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.