ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete a blank cell and shift left (https://www.excelbanter.com/excel-programming/292733-delete-blank-cell-shift-left.html)

jrb[_2_]

Delete a blank cell and shift left
 
I need to figure out a way to take a range, and for each blank cell i
that range delete it and shuft it left. Is there an easy way to d
this?


Thanks JR

--
Message posted from http://www.ExcelForum.com


Medemper

Delete a blank cell and shift left
 
Sub ShiftBlankCellLeft()
'assumes going down current column starting at currentcell location
For i = ActiveCell.Row To Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
If ActiveCell.Value = "" Then
Selection.Delete Shift:=xlToLeft
End If
ActiveCell.Offset(1, 0).Select ' assumes moving down a column
Next i
End Sub
"jrb " wrote in message ...
I need to figure out a way to take a range, and for each blank cell in
that range delete it and shuft it left. Is there an easy way to do
this?


Thanks JRB


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 02:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com