Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Topic did not show up?

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...

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Topic did not show up?

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...



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Topic did not show up?


Hi.

Try: =A1&" - "&TEXT(TODAY(),"dd mmm yy")&" -
"&MID(ADDRESS(1,RANDBETWEEN(1,26)),2,1)&RANDBETWEE N(0,9)&MID(ADDRESS(1,RANDBETWEEN(1,26)),2,1)&RANDB ETWEEN(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 Toolpak
for RANDBETWEEN() to work. Tools-Addins-Analysis Toolpak.

HTH

Regards,
Jon von der Heyden


--
Jon von der Heyden
------------------------------------------------------------------------
Jon von der Heyden's Profile: http://www.officehelp.in/member.php?userid=4852
View this thread: http://www.officehelp.in/showthread.php?t=1245029

Posted from - http://www.officehelp.in

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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...


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
Show last number entered hodkd Excel Discussion (Misc queries) 2 November 9th 05 08:31 PM
Show data used and percent label Desiree Charts and Charting in Excel 2 October 18th 05 04:34 PM
leading zeros are not showing in the formula bar but do show in ce Debbie Excel Discussion (Misc queries) 2 October 2nd 05 03:26 PM
Show values from other sheet TONY Excel Worksheet Functions 0 August 31st 05 03:03 PM
with formulas that show negative results I want to show zero inste brit64 Excel Discussion (Misc queries) 6 August 29th 05 11:12 PM


All times are GMT +1. The time now is 10:26 PM.

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"