View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Mike Rogers
 
Posts: n/a
Default Help with changing a Macro

Good evening:

I have the following macro that "Sloth" was good enough to help me with and
now I need a little change. This now needs to generate these random numbers
in the same place when a button is used. What do I change to make the new
set always appear in the range of M17:M50

Sub Macro1()
Dim myCell As Range
For Each myCell In Selection.Cells
myCell.FormulaR1C1 = "=TEXT(ROUND(10000*RAND(),0),""0000"")"
Next myCell
Selection.Copy
Selection.PasteSpecial Paste:=xlValues
Application.CutCopyMode = False

End Sub

Thank you very much!!!

Mike Rogers