reading values from multi-area selection

G

guest

I have this situation where user picks selected columns in the table ... when
I am trying to read the values its giving me only first selected area values.
I need to read the values row wise, is there anyway that I can read each row
into an array?

For example:

Table
A B C D
1 2 3 4
3 6 8 9

user selects columns A and C .. in this case when I read second row values
I shud get an array with 1, 3 values

Similar thing is required for columns, like user selects row1, row2 and when
I read the column values I should get array with values A, 1.

There can many multiple-area selections. Just wondering is there any simple
to figure this out.

I am doing this in C#. Any help or suggestions would be appreaciated.

thanks.
 
J

Jim Cone

Loop thru the Selection areas...
'--
For Each rArea in Selection.Areas
For Each rCell in rArea
'add rcell value to the array
Next
Next
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"guest" <[email protected]>
wrote in message
I have this situation where user picks selected columns in the table ... when
I am trying to read the values its giving me only first selected area values.
I need to read the values row wise, is there anyway that I can read each row
into an array?

For example:

Table
A B C D
1 2 3 4
3 6 8 9

user selects columns A and C .. in this case when I read second row values
I shud get an array with 1, 3 values
Similar thing is required for columns, like user selects row1, row2 and when
I read the column values I should get array with values A, 1.
There can many multiple-area selections. Just wondering is there any simple
to figure this out.
I am doing this in C#. Any help or suggestions would be appreaciated.
thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top