HELP ME!!! Condensing multiple cells with text and too many blank

  • Thread starter Thread starter Jose
  • Start date Start date
J

Jose

I have several hudred columns of text cells interspersed with blank cells.
Instead of manually deleting each blank cell, I would like to do this with a
formula, or a macro, although I am not good with macros.

I would appreciate any help I can get.

Thanks for your time.
 
hi
can you sort it??? excel's sort moves blanks to the bottom.

regards
FSt1
 
Hi,

I can't sort the data because it's in a specific order and what I need to do
is to condense it so that the text in each of the cells that has text to
follow each other in a consecutive order.

Thanks
 
This code will delete the blank cells (same as you selecting the cell
and deleting to the left). See comment in code below to move cell up
instead

Sub delete_blanks()
For myCol = 1 To Selection.Columns.Count
For myRow = 1 To Selection.Rows.Count
If Selection.Cells(myRow, myCol).Value = "" Then
Selection.Cells(myRow, myCol).Delete Shift:=xlToLeft
'change this to xlUp if you want to move cells up when you delete
End If
Next
Next

End Sub
 
F5>Special>Blanks>OK

Edit>Delete>Shift cells up?


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top