ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Not so Random Numbers (https://www.excelbanter.com/excel-programming/406850-not-so-random-numbers.html)

Office_Novice

Not so Random Numbers
 
Greetings

I have been using this Me.bxnum.Value = Int((100000000000# * Rnd)
+ 1)
to populate a textbox used to assign a number to a storage box. it works ok.
i would like to know if there is a way to use a number as a starting point
i.e. 501 and the add 1 to that number daily. any ideas? Rather then using
completly random numbers.


tigoda

Not so Random Numbers
 
have it store the value somewhere on the sheet?

you could just use

range("a1").value = range("a1").value +1

if the value is already held in the textbox pull it from there and use this

"Office_Novice" wrote:

Greetings

I have been using this Me.bxnum.Value = Int((100000000000# * Rnd)
+ 1)
to populate a textbox used to assign a number to a storage box. it works ok.
i would like to know if there is a way to use a number as a starting point
i.e. 501 and the add 1 to that number daily. any ideas? Rather then using
completly random numbers.


Office_Novice

Not so Random Numbers
 
Thanks, thats a good start but the range changes so how would i have to
enter the range?

"tigoda" wrote:

have it store the value somewhere on the sheet?

you could just use

range("a1").value = range("a1").value +1

if the value is already held in the textbox pull it from there and use this

"Office_Novice" wrote:

Greetings

I have been using this Me.bxnum.Value = Int((100000000000# * Rnd)
+ 1)
to populate a textbox used to assign a number to a storage box. it works ok.
i would like to know if there is a way to use a number as a starting point
i.e. 501 and the add 1 to that number daily. any ideas? Rather then using
completly random numbers.


tigoda

Not so Random Numbers
 
stick it in a call thats not going to be used, set the text colour to white

or if you mean it moves because new rows are added you counld use the
Range("A1").End(xlDown).value to select the last value in the range

"Office_Novice" wrote:

Thanks, thats a good start but the range changes so how would i have to
enter the range?

"tigoda" wrote:

have it store the value somewhere on the sheet?

you could just use

range("a1").value = range("a1").value +1

if the value is already held in the textbox pull it from there and use this

"Office_Novice" wrote:

Greetings

I have been using this Me.bxnum.Value = Int((100000000000# * Rnd)
+ 1)
to populate a textbox used to assign a number to a storage box. it works ok.
i would like to know if there is a way to use a number as a starting point
i.e. 501 and the add 1 to that number daily. any ideas? Rather then using
completly random numbers.


Office_Novice

Not so Random Numbers
 
Thanks alot, I know it was simple but i am still new at this.

"tigoda" wrote:

stick it in a call thats not going to be used, set the text colour to white

or if you mean it moves because new rows are added you counld use the
Range("A1").End(xlDown).value to select the last value in the range

"Office_Novice" wrote:

Thanks, thats a good start but the range changes so how would i have to
enter the range?

"tigoda" wrote:

have it store the value somewhere on the sheet?

you could just use

range("a1").value = range("a1").value +1

if the value is already held in the textbox pull it from there and use this

"Office_Novice" wrote:

Greetings

I have been using this Me.bxnum.Value = Int((100000000000# * Rnd)
+ 1)
to populate a textbox used to assign a number to a storage box. it works ok.
i would like to know if there is a way to use a number as a starting point
i.e. 501 and the add 1 to that number daily. any ideas? Rather then using
completly random numbers.



All times are GMT +1. The time now is 01:47 AM.

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