Thread: Range question
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
TK TK is offline
external usenet poster
 
Posts: 177
Default 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!