Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Selecting Variable Rows

Hello,

I am attempting to get some code to work that looks like:

X = X + 95
Y = Y + 95
Rows("X:Y").Select

Basically I need to to be able to change the values of the
rows I need to select. I cant find anything in help, so
could someone help me with the syntax.

Thanks

Matt D.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Selecting Variable Rows

Hi Matt

Try this

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


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Matt D." wrote in message ...
Hello,

I am attempting to get some code to work that looks like:

X = X + 95
Y = Y + 95
Rows("X:Y").Select

Basically I need to to be able to change the values of the
rows I need to select. I cant find anything in help, so
could someone help me with the syntax.

Thanks

Matt D.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Selecting Variable Rows

X = X + 95
Y = Y + 95
Rows(X & ":" & Y).Select

--
Regards,
Tom Ogilvy

"Matt D." wrote in message
...
Hello,

I am attempting to get some code to work that looks like:

X = X + 95
Y = Y + 95
Rows("X:Y").Select

Basically I need to to be able to change the values of the
rows I need to select. I cant find anything in help, so
could someone help me with the syntax.

Thanks

Matt D.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default Selecting Variable Rows

Just two other ideas. If X is always less than Y:
Rows(X).Resize(Y - X + 1).Select

If not, than another idea:
Range(Cells(X, 1), Cells(Y, 1)).EntireRow.Select

Dana DeLouis

"Matt D." wrote in message
...
Hello,

I am attempting to get some code to work that looks like:

X = X + 95
Y = Y + 95
Rows("X:Y").Select

Basically I need to to be able to change the values of the
rows I need to select. I cant find anything in help, so
could someone help me with the syntax.

Thanks

Matt D.



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
Selecting Variable Data Ranges rc Excel Discussion (Misc queries) 2 May 18th 07 08:26 PM
Selecting a row with a variable ? Blewyn[_6_] Excel Programming 3 April 20th 04 08:16 AM
Selecting Variable Row Range w/Macro steve Excel Programming 3 February 26th 04 07:24 PM
Selecting rows with variable Jim[_24_] Excel Programming 7 September 16th 03 02:03 PM
Selecting a Range Using a Variable Bob J. Excel Programming 4 September 14th 03 09:24 PM


All times are GMT +1. The time now is 04:52 AM.

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"