Link to home
Start Free TrialLog in
Avatar of dsulkar
dsulkar

asked on

Loop through a selection set in a grid, it is a control that I bought called Flexcell grid

This should be pretty easy but I don't have a handle on the exact selection set using a Flexcell grid. This is not the ms grid since it did not have the flexibility I needed, but it seems very similar.
I need to know the starting and ending Rows/Cols in the grid that have been selected so I can process that specific area. if anyone knows how I can do this with right click functionality that would be great. I just need to go cell by cell that has been selected.
Thanks
Div
ASKER CERTIFIED SOLUTION
Avatar of Zhaolai
Zhaolai
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dsulkar
dsulkar

ASKER

Here is what I get
And this has been my problem, I would have hoped that this info was readily available.

oSelection.FirstRow method or data member not found.

it is acting like you can only work on the selection and not one cell at a time.

I have a work around but It is ugly

Please remember this is an aftermarket grid called Flexcell grid version 5.8.4

Thanks
Hmmm... I downloaded the trial version (5.8.4) of the control.
Open Object Browser (Press F2 in VB6 IDE). Select FlexCell. Do you see the same thing as the attached screenshot below (FirstCol, FirstRow, LastCol, LastRow)?


Screenshot.PNG
Avatar of dsulkar

ASKER

I am using vba and access 2000, The object browser shows exactly what you sent. Still trying to figure out why it won't work
Thanks
Avatar of dsulkar

ASKER

OK I changed it to this and it worked fine, any ideas why the dim of the selection did not work?

With GridMain.Selection
For i = .FirstRow To .LastRow 'FirstRow To oSelection.LastRow
    For j = .FirstCol To .LastCol
        MsgBox GridMain.Cell(i, j).Text
    Next
Next
End With

Either way, thats all I was looking for. Thanks for reminding me to look at the object browser, I was just relying on the help file.
Change
    Dim oSelection As Selection
to
    Dim oSelection As FlexCell.Selection

I suspect that Selection may have multiple definitions.


Avatar of dsulkar

ASKER

Exactly right
Thanks a bunch, my brain was just not wanting to work. I appreciate the help.
Div
Avatar of dsulkar

ASKER

This is why I love this site, get quick answers in a pinch
Avatar of dsulkar

ASKER

Hey there why did it only give the solution an 8.8 when it should have been 10?