Hi All,
I have a table with the following:
..........A............B................C...............D..........E ........F...........G............H
1...... Name.....Address..........Tel........... Fruit1....Fruit2...Fruit3....Fruit4.......Fruit5
2...... Detail1......................Detail2.........Txt1................Txt2....................Txt3
3...... Detail1......................Detail2.........Txt1......Txt2....Txt3
(Dots are used as spacers to keep columns in line)
The columns for Name, address & Tel are allowed to have blank columns.
The columns for Fruit1 to Fruit5 need to be consolidated to the left, leaving no blank columns.
Row 2 is the original and row 3 is how it needs to look.
I can do this using an array formula in D3:H3
{=IFERROR(INDEX($D$3:$H$3, SMALL(IF(($D$3:$H$3="")+ISERROR(($D$3:$H$3), "", COLUMN(($D$3:$H$3)-MIN(COLUMN(($D$3:$H$3))+1), COLUMN(A1))),"")}
But I need to do this in VBA.
Can anyone assist?
Bookmarks