View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ronald Dodge Ronald Dodge is offline
external usenet poster
 
Posts: 111
Default Variable upper and Lower row selection

It would be something like:

Workbooks("Book1.xls").Worksheets("Sheet1").Range( CStr(x) & ":" &
CStr(y)).Select

The Rows object is actually a collection object, thus the argument within
the paranthesis is expecting a numeric value from 1 to the number of rows
within that collection, such as if x is 4 and y is 9, then the Rows
collection object would have a total of 6 different Row objects within it as
indicated by the Count property on the Rows collection object:

Workbooks("Book1.xls").Worksheets("Sheet1").Range( CStr(x) & ":" &
CStr(y)).Rows.Count

--
Ronald R. Dodge, Jr.
Production Statistician/Programmer
Master MOUS 2000

"Bythsx-Addagio" wrote in message
...
Hello all,

I have the following
Rows("1:" & x).Select

But now I am trying to find the syntax for selecting rows based on two
variables.

ie.
x= upper_limit
y=lower_limit

Rows(x:y).Select

this gives me an error: Expected list seperator or )

Help please.