Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Variable upper and Lower row selection

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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Variable upper and Lower row selection

rows(X & ":" & Y).Select

make sure there is a space between the variable and the ampersand.

--
Regards,
Tom Ogilvy


"Bythsx-Addagio" wrote:

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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upper Case Letters to First Letter Upper, Remaining Letters Lower SueW Excel Discussion (Misc queries) 7 February 25th 10 05:32 PM
convert lower to upper case automatically without using UPPER Sal Excel Discussion (Misc queries) 6 July 26th 09 11:27 AM
Changing upper case characters to upper/lower Richard Zignego Excel Discussion (Misc queries) 1 December 17th 07 10:09 PM
Change from mixed caps and upper lower to all upper lower case Fish''s Mermaid Excel Worksheet Functions 3 October 13th 06 02:15 PM
How do I convert all upper case excel sheet into upper and lower . DebDay Excel Discussion (Misc queries) 1 March 9th 05 08:31 PM


All times are GMT +1. The time now is 11:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"