Re: $$Excel-Macros$$ Parsing a range to an array

2010-10-30 Thread frank
Hello, You can also loop through the various selected areas and process the cells as needed. dim rngCell as Range For Each rngCell In Selection.Areas varXRange() = rngCell Next On Oct 28, 4:30 am, Dave Bonallack wrote: > Hi, > You can test for a non-contiguous selection with the followi

RE: $$Excel-Macros$$ Parsing a range to an array

2010-10-28 Thread Dave Bonallack
Hi, You can test for a non-contiguous selection with the following line of code: A = Selection.Areas.Count Use this in an If statement - eg If Selection.Areas.Count > 1 then msgbox "You can't use non-contiguous cells.": Exit Sub Hope this helps. Regards - Dave. > Date: Thu, 28 Oct 20