Thread: [Solved] deleting blanks and commas
View Single Post
 
Old 03-01-2017, 10:29 AM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

You want to delete the cell but not the row ???
Okay, so what's to happen?
Cells from below move up or cells from the right move left?

Seeing column B is now in the picture, maybe this is what you need
Code:
Sub CopyInto_B()
    Dim lastrow As Long, writerow As Long
    Dim i As Long
    
With Sheets("Sheet1")
    lastrow = .Cells(Rows.Count, "A").End(xlUp).Row
    writerow = 1
    For i = 1 To lastrow
        If .Cells(i, 1).Value <> "" And .Cells(i, 1).Value <> "," Then
            .Cells(writerow, 2).Value = .Cells(i, 1).Value
            writerow = writerow + 1
        End If
    Next i
End With
End Sub
Reply With Quote