I'm loving Interse

P

Phil Hibbs

I really like the Intersect function. I use it a lot, for instance if my VBA wants to process every row that the user has selected:

Set ProcessRange = Intersect( ActiveSheet.UsedRange, Selection.EntireRow, Cells(1,1).EntireColumn )

It also removed duplciate selected cells. ProcessRange.Count tells me how many rows are selected.

Any time you process a set of selected cells, Intersect( Selection, ActiveSheet.UsedRange ) will remove thousands of redundant cells that you don't need to process.

Phil.
 

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