ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Range question (https://www.excelbanter.com/excel-programming/312750-range-question.html)

strataguru[_21_]

Range question
 

And to update....

I'd like range A1 through AQ188 - how do I pass that into a range?
These values are dynamic and can change at any time.

Thanks

--
stratagur
-----------------------------------------------------------------------
strataguru's Profile: http://www.excelforum.com/member.php...nfo&userid=131
View this thread: http://www.excelforum.com/showthread.php?threadid=26337


Myrna Larson

Range question
 
You would specify the maximum row number (188) and column number (whatever AQ
is -- I don't know off hand) as arguments and substitute these for X in a
statement like Rnd()*X


On Wed, 6 Oct 2004 17:52:59 -0500, strataguru
wrote:


And to update....

I'd like range A1 through AQ188 - how do I pass that into a range?
These values are dynamic and can change at any time.

Thanks!



TK

Range question
 
Hi: Stataguru

Not to sure where you are with this or what you want to
to accomplish. The following will place the cellpointer
randomly in the location you indicated.

Private Sub CommandButton1_Click()

Dim cnum As Integer
Dim rnum As Integer

'/ generate a random number up to n
'/ change the (Rnd * n) to encrease
'/ the random output dimension
Randomize
cnum = Int(Rnd * 43 + 1)
rnum = Int(Rnd * 188 + 1)

MsgBox "The column number is " & cnum & " and the" _
& " row number is " & rnum & ".", , "Good Luck TK"

Worksheets("Sheet1").Cells(rnum, cnum).Select

End Sub

Good Luck
TK

On Wed, 6 Oct 2004 17:52:59 -0500, strataguru
wrote:


And to update....

I'd like range A1 through AQ188 - how do I pass that into a range?
These values are dynamic and can change at any time.

Thanks!





All times are GMT +1. The time now is 02:55 AM.

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