ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Range object and worksheet change event (https://www.excelbanter.com/excel-programming/373674-range-object-worksheet-change-event.html)

Paulymon

Range object and worksheet change event
 
I have a a spreadsheet that has filters on it. I want to be able to itterate
through a range that is selected using the worksheet's change event.
The target range might be $e200,$e300,$e500:$e510

I want to be able to do something like

for each row in target.range
x= ...cell(1,row#).value
next

So I would run through the loop for row 200, row 300, and rows 500-510

Any advice on how to accomplish this would be appreciated.

Bob Phillips

Range object and worksheet change event
 
For Each cell In Target.Entirerow
x= ...cell.value
Next



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Paulymon" wrote in message
...
I have a a spreadsheet that has filters on it. I want to be able to

itterate
through a range that is selected using the worksheet's change event.
The target range might be $e200,$e300,$e500:$e510

I want to be able to do something like

for each row in target.range
x= ...cell(1,row#).value
next

So I would run through the loop for row 200, row 300, and rows 500-510

Any advice on how to accomplish this would be appreciated.




Paulymon

Range object and worksheet change event
 
I would like to not have to step through each cell in the selection. I've
used the for each cell statement before for other purposes. I would like a
for each row in selection type response. Thanks for your input.

"Bob Phillips" wrote:

For Each cell In Target.Entirerow
x= ...cell.value
Next



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Paulymon" wrote in message
...
I have a a spreadsheet that has filters on it. I want to be able to

itterate
through a range that is selected using the worksheet's change event.
The target range might be $e200,$e300,$e500:$e510

I want to be able to do something like

for each row in target.range
x= ...cell(1,row#).value
next

So I would run through the loop for row 200, row 300, and rows 500-510

Any advice on how to accomplish this would be appreciated.





Bob Phillips

Range object and worksheet change event
 
What do you want to do with each row, and will whole rows be selected or
just cells?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Paulymon" wrote in message
...
I would like to not have to step through each cell in the selection. I've
used the for each cell statement before for other purposes. I would like

a
for each row in selection type response. Thanks for your input.

"Bob Phillips" wrote:

For Each cell In Target.Entirerow
x= ...cell.value
Next



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Paulymon" wrote in message
...
I have a a spreadsheet that has filters on it. I want to be able to

itterate
through a range that is selected using the worksheet's change event.
The target range might be $e200,$e300,$e500:$e510

I want to be able to do something like

for each row in target.range
x= ...cell(1,row#).value
next

So I would run through the loop for row 200, row 300, and rows 500-510

Any advice on how to accomplish this would be appreciated.








All times are GMT +1. The time now is 05:53 PM.

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