PDA

View Full Version : Investigating the selection



chamster
09-03-2007, 08:08 AM
How do i check the number of rows, columns, etc. of a Selection-object?

chamster
09-03-2007, 08:09 AM
Also, i forgot to add - how can i force VBA to always view a list of complishions? Sometimes i get to see it after a period, sometimes i don't. How do i force it?

On the same tune - how can i check all the properties of Selection myself ?

rory
09-03-2007, 08:25 AM
You can use Selection.Rows.Count and Selection.Columns.Count if the selection consists of a single block of cells. (You should also check that the selection is in fact a range)
The Intellisense will usually pop up if it is clear what kind of object is being referred to. You can also press Ctrl+J to display them where available.

chamster
09-03-2007, 08:44 AM
Thanks! Now, let me turn the question around. I'd like to discover when the selection (target sent into a method, actually, always being a range, not neccessarily a simple/single one) is consisted of exactly one cell. How can that be done?

rory
09-03-2007, 08:47 AM
Check Selection.Count to see if it equals 1.

chamster
09-03-2007, 09:30 AM
Nice! Thanks!