ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dynamic Row Selection (https://www.excelbanter.com/excel-programming/271582-dynamic-row-selection.html)

Bruce B[_2_]

Dynamic Row Selection
 


I'm trying to select rows based on a parameter passed to the sub
procedure that selects the row.

I know if I want a set row then I could do:

Rows(6:6).Select

However, let's say I have a parameter r that contains the row number I
want to select.

I tried:

Rows(r.Value + ":" + r.Value).Select

However, this just gives me an error.

Any help would be appreciated.

Thanks!

- Bruce

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Don Guillett[_4_]

Dynamic Row Selection
 
try
Rows(r.Value + ":" + r.Value).Select

Rows(r & ":" & r).Select


--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Bruce B" wrote in message
...


I'm trying to select rows based on a parameter passed to the sub
procedure that selects the row.

I know if I want a set row then I could do:

Rows(6:6).Select

However, let's say I have a parameter r that contains the row number I
want to select.

I tried:

Rows(r.Value + ":" + r.Value).Select

However, this just gives me an error.

Any help would be appreciated.

Thanks!

- Bruce

*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




Tom Ogilvy

Dynamic Row Selection
 
rows(6).Select

works as well,

rw = 6
rows(rw).Select

Regards,
Tom Ogilvy


"Bruce B" wrote in message
...


I'm trying to select rows based on a parameter passed to the sub
procedure that selects the row.

I know if I want a set row then I could do:

Rows(6:6).Select

However, let's say I have a parameter r that contains the row number I
want to select.

I tried:

Rows(r.Value + ":" + r.Value).Select

However, this just gives me an error.

Any help would be appreciated.

Thanks!

- Bruce

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




Matt Lunn

Dynamic Row Selection
 
What's the data type of r.value? Was the error a 1004?
-----Original Message-----


I'm trying to select rows based on a parameter passed to

the sub
procedure that selects the row.

I know if I want a set row then I could do:

Rows(6:6).Select

However, let's say I have a parameter r that contains

the row number I
want to select.

I tried:

Rows(r.Value + ":" + r.Value).Select

However, this just gives me an error.

Any help would be appreciated.

Thanks!

- Bruce

*** Sent via Developersdex http://www.developersdex.com

***
Don't just participate in USENET...get rewarded for it!
.


Bruce B[_2_]

Dynamic Row Selection
 


The variable was an integer.

I think the first two replies should work.

Thanks for the help!

- Bruce

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 12:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com