Help with VBA

  • Thread starter Thread starter Guest
  • Start date Start date
Hi,
I would like to use a command button for this excel formula
=randbetween(1,100)


Try:

'=============>>
Private Sub CommandButton1_Click()
Selection.Formula = "=RandBetween(1,100)"
End Sub
'<<=============
 
Hi Need help with sumif,
I'm sorry what I meant was Cells(3,3) = randbetween(1,100)

Try:

'=============>>
Private Sub CommandButton1_Click()
Me.Cells(3,3).Formula = "=RandBetween(1,100)"
End Sub
'<<=============
 
Back
Top