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/89994-help-vba.html)

Need help with sumif

Help with VBA
 
I need to to this with VBA

A1=randbetween(1,100)

Norman Jones

Help with VBA
 
Hi Need help with sumif,

Try:

'=============
Private Sub CommandButton1_Click()
Me.Range("A1").Formula = "=RandBetween(1,100)"
End Sub
'<<=============


---
Regards,
Norman



"Need help with sumif" wrote
in message ...
I need to to this with VBA

A1=randbetween(1,100)




Need help with sumif

Help with VBA
 
Thanks it works great when you get a chance can you explain me what

Me.cells(3,3) is for?

"Norman Jones" wrote:

Hi Need help with sumif,

Try:

'=============
Private Sub CommandButton1_Click()
Me.Range("A1").Formula = "=RandBetween(1,100)"
End Sub
'<<=============


---
Regards,
Norman



"Need help with sumif" wrote
in message ...
I need to to this with VBA

A1=randbetween(1,100)





Norman Jones

Help with VBA
 
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:

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



---
Regards,
Norman



Leviatano

Help with VBA
 


"Need help with sumif" wrote:

Thanks it works great when you get a chance can you explain me what

Me.cells(3,3) is for?

"Norman Jones" wrote:

Hi Need help with sumif,

Try:

'=============
Private Sub CommandButton1_Click()
Me.Range("A1").Formula = "=RandBetween(1,100)"
End Sub
'<<=============


---
Regards,
Norman



"Need help with sumif" wrote
in message ...
I need to to this with VBA

A1=randbetween(1,100)





Leviatano

Help with VBA
 


"Need help with sumif" wrote:

I need to to this with VBA

A1=randbetween(1,100)


Leviatano

Help with VBA
 


"Norman Jones" wrote:

Hi Need help with sumif,

Try:

'=============
Private Sub CommandButton1_Click()
Me.Range("A1").Formula = "=RandBetween(1,100)"
End Sub
'<<=============


---
Regards,
Norman



"Need help with sumif" wrote
in message ...
I need to to this with VBA

A1=randbetween(1,100)





Leviatano

Help with VBA
 


"Norman Jones" wrote:

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:

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



---
Regards,
Norman





All times are GMT +1. The time now is 09:59 AM.

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