How do i check the number of rows, columns, etc. of a Selection-object?
How do i check the number of rows, columns, etc. of a Selection-object?
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 ?
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.
Regards,
Rory
Microsoft MVP - Excel
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?
Check Selection.Count to see if it equals 1.
Regards,
Rory
Microsoft MVP - Excel
Nice! Thanks!