Nice but add these changes:
1) Instead of vbBlue color try this: &H8000000D
2) Also set the grid property highlight to: "always"
P.S. I think this code has one bug: Try the selection not starting by left-up corner but by right-down. What is going on there?
Michael Vlastos
Company MODUS SA
Development Department
Athens, Greece
Tel: +3-01-9414900
Re: Nice but add these changes:
I just knocked this code out for you to try - I'm certainly not going to bug-fix it as well ;-)
I wouldn't actually use the '&H8000000D' value - try using the vb constant 'vbHighlight' - the user just might change their display settings. I used vbBlue because I'm just lazy :)
>P.S. I think this code has one bug: Try the selection not starting by
>left-up corner but by right-down. What is going on there?
? What do you mean ?
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
Re: Nice but add these changes:
You are right about the color! Thanx!
About the bug now:
I mean that it works well if you start dragging form the UPPER-LEFT corner. If you try to select a region from the DOWN-RIGHT corner of the region then something wrong happens... Can you try it plz?
Michael Vlastos
Company MODUS SA
Development Department
Athens, Greece
Tel: +3-01-9414900
Re: Nice but add these changes:
Found it :
My fault entirely, you need to change the 'lStartCol' line to read :
lStartCol = IIf(.ColSel < .Col, .ColSel, .Col)
Chris Eastwood
CodeGuru - the website for developers
http://www.codeguru.com/vb
Thanx! One more expansion::
Thanx Chris! I couldn't not to rate it :-)
Well one more expansion:
Take a look at the following scenario:
The user has selected some regions but when it selects a new region that contains some cells of another already selected, then it deselects the common cells. That is not desirable.
Michael Vlastos
Company MODUS SA
Development Department
Athens, Greece
Tel: +3-01-9414900