View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
charles charles is offline
external usenet poster
 
Posts: 124
Default Delete Blank Cells in a Row

Hi Bob

This also works. Thank you, all all the experts who reply so quickly and
concisely.

Regards

Charles

"Bob Phillips" wrote:

Untested

Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long, j As Long
Dim LastRow As Long
Dim LastCol As Long

With ActiveSheet

LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = 1 To LastRow

LastCol = .Cells(i, .Columns.Count).End(xlToLeft).Column
For j = LastCol To 2 Step -1

If .Cells(i, j).Value = "" Then

.Cells(i, j).Delete Shift:=xlToLeft
End If
Next j
Next i
End With

End Sub

--
__________________________________
HTH

Bob

"Charles" wrote in message
...
I have 8000+ rows of data where each row has bank cells in random
positions,
except for Column A which is aways populated.

Can someone help me with a script that will check each row, delete the
bank
cell by moving the other cells in the row to the left.

Thanks