Re: $$Excel-Macros$$ Union to transfor a non-contiguous to a contiguous range In VBA

2011-09-28 Thread excelCPA
Thanks for the response, but unfortunately this doesn't work with the XIRR function as it only accepts 1-dimensional ranges. The resulting ‘urmg’ variable is a 2-dimensional range since the first range is in column B and the second range is in column C. The reulting urmg range basically looks lik

Re: $$Excel-Macros$$ Union to transfor a non-contiguous to a contiguous range In VBA

2011-09-28 Thread ashish koul
Sub union_data() Dim s As Range, unrng As Range Set unrng = Union(Range("b1:b4"), Range("c4")) For Each s In unrng MsgBox s.Value Next End Sub On Wed, Sep 28, 2011 at 9:04 PM, excelCPA wrote: > I am trying (unsuccessfully) to dynamically transform a single column > non-contiguous data range to

$$Excel-Macros$$ Union to transfor a non-contiguous to a contiguous range In VBA

2011-09-28 Thread excelCPA
I am trying (unsuccessfully) to dynamically transform a single column non-contiguous data range to single column contiguous range using VBA, basically dynamically appending the second range to the first. My spreadsheet is as follows: Column A contains a series of dates in sequential order Column