Blank Cells Horizontal
Single Row - Manually
Highlight the cells containing all the cells, including the blank cells.
(Home tab, Editing Group)(Find & Select - GoTo Special) or (F5, Special).
This will display the "Go To Special" dialog box.
Select Blanks and press OK.
This will select all the cells that are blank.
Then remove the entire columns for all the selected cells.
(Home Tab, Cells Group)(Delete > Delete Cells, Entire Column).
Right mouse click and press Delete.
This will display the Delete dialog box.
Choose "Shift Cells Up" and press OK.
The Undo (Ctrl + Z) can be used if you want to put the blank cells back.
Single Row - Formula (underneath)
This formula will display the list (without the blanks) underneath the original list (using the same column).
=IFERROR(INDEX($B2:$K2,SMALL(IF($B2:$K2<>"",COLUMN($B2:$K2)-COLUMN($B2)+1,""),COLUMNS($B4:B4))),"")
Place this formula in cell "B4" and press Enter.
Drag this cell across to cell "K4".
Single Row - Formula (alongside)
A formula can be used if you want to keep the original list.
This formula will display the list (without the blanks) alongside the original list (using the same rows).
=IFERROR(INDEX($B2:$K2,SMALL(IF($B2:$K2<>"",COLUMN($B2:$K2)-COLUMN($B2)+1,""),COLUMNS($M2:M2))),"")
Place this formula in cell "M2" and press Enter.
Drag this cell across to cell "S2".
VBA User Defined Function
NONBLANKVALUES - Returns a cell range with all the blanks removed.
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext