Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default return random letters - an example

No question here just a procedure for the archive.

Return a random letter for each cell in selection

Sub RandomLetterGenerator()

'Returns a random letter in each cell in selection
On Error Resume Next
Selection.FormulaR1C1 = "=CHAR(TRUNC(RAND()*26+65))"

'Paste value the formulas

Selection.Copy

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

End Sub

search criteria
return random letters
insert random letters
generate random letters

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default return random letters - an example

Just so that this doesn't appear unanswered, one comment: no need for the pastespecial:

Sub RandomLetterGenerator2()
'Returns a random letter in each cell in selection
Selection.FormulaR1C1 = "=CHAR(TRUNC(RAND()*26+65))"
Selection.Value = Selection.Value
End Sub

HTH,
Bernie
MS Excel MVP


wrote in message
oups.com...
No question here just a procedure for the archive.

Return a random letter for each cell in selection

Sub RandomLetterGenerator()

'Returns a random letter in each cell in selection
On Error Resume Next
Selection.FormulaR1C1 = "=CHAR(TRUNC(RAND()*26+65))"

'Paste value the formulas

Selection.Copy

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

End Sub

search criteria
return random letters
insert random letters
generate random letters



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
Return two random lines Jeremy Excel Worksheet Functions 1 April 22nd 09 03:16 AM
How to? Create random letters and numbers in a cell Chris Excel Worksheet Functions 3 June 5th 08 08:04 AM
How to return a number into letters? A.El Tohamy Excel Worksheet Functions 4 January 20th 08 01:53 PM
random combination of letters rp Excel Worksheet Functions 1 September 16th 05 02:40 PM
trying to find random drive letters VBAfunkymonk Excel Programming 2 February 11th 05 10:45 AM


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

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

About Us

"It's about Microsoft Excel"