View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Sloth
 
Posts: n/a
Default Random number Macro

Sub Macro1()
ActiveCell.FormulaR1C1 = "=TEXT(ROUND(10000*RAND(),0),""0000"")"
Selection.Copy
Selection.PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
End Sub


"Mike Rogers" wrote:

XL2K

Is it possible to use a macro to place a random number in the active cell,
and not re-calc? I am trying to place a 4 diget ID number in a cell and need
it to not re-calc. I would like it to be random as opposed to assigned. Is
there a better way?

Mike Rogers