hi i have this data set from hell. the data when i get it would have the fields spill across columns unevenly. so there may be some rows with 3 columns, 4 columns or 5 columns
This is the data
o o x y
o o o x y
o o oxo y
o o y
desired data cleaned up
oo x y
ooo x y
oo oxo y
o o y
what i attempt to do is
- read row wise till detect x
- concatenate all the O's on the first column
- delete all the other O's so that the x and y can move to the left
- sometimes the x may be wrapped in some other text
- sometimes there may not even be an x at all. then i would skip on to the next row rather than loop infinite
i have searched up and down the forum, but the closest i can find to my problem is How to concatenate cells in a row until the first blank cell sadly, the final answer for where instead of a blank cell to be a specific value is not shared there.
i tried my luck with my crude skills in VBA but eh...i think i end up confusing myself more he he he
Sub x()
Dim n As Long, r1 As Range, r2 As Range, v
For n = 1 To Range("A" & Rows.Count).End(xlUp).Row
On Error Resume Next
Rng.SpecialCells(xlCellTypeConstants).Select
If Not r1 = "x" And Not r2 Is Nothing Then
v = Join(Application.Transpose(Application.Transpose(r1)), " ")
Cells(n, 2).Resize(, r1.Count).Clear
r2.Cut Cells(n, 3)
End If
ActiveCell.Offset(1, 0).Select
Next n
End Sub
` any help would very much be appreciated here