return random letters - an example

A

aztecbrainsurgeon

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
 
B

Bernie Deitrick

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top