Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Varible in a Range
Is there a way to specify a range based on a varible, for example
Range("Asomenumber").Select eg. where somenumber = 5, so that A5 in this case is selcted, but i somenumber changed then another cell selected -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Varible in a Range
As far as I know, the only way to create ranges based on variables is by using the Cells collection. For example: myWS.Cells(myRow, myCol).Select myWS - Worksheet Object myRow - an Int or Long ( 32768 limitation on some systems) myCol - Int -----Original Message----- Is there a way to specify a range based on a varible, for example Range("Asomenumber").Select eg. where somenumber = 5, so that A5 in this case is selcted, but if somenumber changed then another cell selected. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Varible in a Range
mushy_peas < wrote:
Is there a way to specify a range based on a varible, for example Range("Asomenumber").Select eg. where somenumber = 5, so that A5 in this case is selcted, but if somenumber changed then another cell selected. SomeNumber = 5 Range("A" & SomeNumber).Select Will get you to A5. Regards, -- Beto Reply: Erase between the dot (inclusive) and the @. Responder: Borra la frase obvia y el punto previo. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Varible in a Range
I tried the myWS method cos i wanted to specify the colume too. but i
coulndt get it to work. one thing i spottte was:- (myRow, myCol). normally its colum then row, eg B10 any ideas why. this is what i have Dim myWS As Object Dim myRow As Integer Dim myCol As Integer myRow = 10 myCol = 2 ' myWS.Cells(myCol, myRow).Select myWS.Cells(myRow, myCol).Select --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
same varible in formula | Excel Worksheet Functions | |||
varible calculation | New Users to Excel | |||
varible table not | Excel Worksheet Functions | |||
varible table | Excel Worksheet Functions | |||
how to start from varible row | Excel Programming |