ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Help with VBA (https://www.excelbanter.com/excel-discussion-misc-queries/89991-help-vba.html)

Need help with sumif

Help with VBA
 
I would like to use a command button for this excel formula

=randbetween(1,100)




Norman Jones

Help with VBA
 
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
'<<=============


---
Regards,
Norman



Need help with sumif

Help with VBA
 
I'm sorry what I meant was Cells(3,3) = randbetween(1,100)

"Norman Jones" wrote:

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
'<<=============


---
Regards,
Norman




Norman Jones

Help with VBA
 
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
'<<=============


---
Regards,
Norman




All times are GMT +1. The time now is 03:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com