Hi Rick,
I did it 'my way':
Code:Function F_expand(c00) sn = Split(Replace(Replace(Replace(Trim(c00), " -", "-"), "- ", "-"), ",", " ")) For j = 0 To UBound(sn) If InStr(sn(j), "-") Then If Val(sn(j)) = 0 Then c01 = Left(sn(j), InStr(sn(j), "-") - Len(Format(Val(StrReverse(Left(sn(j), InStr(sn(j), "-"))))))) sp = Split(Replace(sn(j), c01, ""), "-") If Val(sp(0)) > Val(sp(1)) Then c02 = Val(sp(0)) + Val(sp(1)) & "-" sn(j) = c01 & Join(Evaluate("transpose(" & c02 & "row(" & sp(0) & ":" & sp(1) & "))"), "," & c01) End If Next F_expand = Join(sn, ",") End Function




Reply With Quote
Bookmarks