Help with VBA

  • Thread starter Thread starter Guest
  • Start date Start date
Hi Need help with sumif,

Try:

'=============>>
Private Sub CommandButton1_Click()
Me.Range("A1").Formula = "=RandBetween(1,100)"
End Sub
'<<=============
 
Hi Need help with sumif,
Thanks it works great when you get a chance can you explain me what
Me.cells(3,3) is for?

Since the (CommandButton) code is in a worksheet module, Me refers to the
worksheet holding the code.

Cells(3.3) is equivalent to Range("C3") and was used because you specified
it:
 
Norman Jones said:
Hi Need help with sumif,

Try:

'=============>>
Private Sub CommandButton1_Click()
Me.Range("A1").Formula = "=RandBetween(1,100)"
End Sub
'<<=============
 
Norman Jones said:
Hi Need help with sumif,


Since the (CommandButton) code is in a worksheet module, Me refers to the
worksheet holding the code.

Cells(3.3) is equivalent to Range("C3") and was used because you specified
it:
 
Back
Top