Sub Concat_Offsets()
Dim lr As Long
lr = Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False
With ActiveSheet
If .AutoFilterMode Then .AutoFilterMode = False
With .Range("A1:A" & lr)
.AutoFilter 1, ">0"
With .Range("B2:B" & lr)
.Formula = "=R[-1]C[-1]&RC[-1]"
End With
End With
.AutoFilterMode = False
End With
With Range("B2:B" & lr)
.Value = .Value
.SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp
End With
Application.ScreenUpdating = True
End Sub
=VALUE(OFFSET($A$2,(ROW()*2)-4,0) & OFFSET($A$2,(ROW()*2)-3,0))
Book1 | ||||
---|---|---|---|---|
A | B | |||
1 | From | To | ||
2 | + | 5 | ||
3 | 5 | 2 | ||
4 | + | -1 | ||
5 | 2 | -8 | ||
6 | - | |||
7 | 1 | |||
8 | - | |||
9 | 8 | |||
Sheet4 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B2:B5 | B2 | =LET(w,WRAPROWS(A2:A9,2),IF(CHOOSECOLS(w,1)="+",1,-1)*CHOOSECOLS(w,2)) |
Dynamic array formulas. |
That is pretty cool! Why didn't you suggest it the first time around!Why not just
Excel Formula:=TOCOL(--(A2:A8&A3:A9),2)