I'm new to VBA Excel. I wanted to write a code that aligns data in Column A to that in Column B then deletes the empty rows left My Data example is as follows:
Desired output looks like this.
I'm new to VBA Excel. I wanted to write a code that aligns data in Column A to that in Column B then deletes the empty rows left My Data example is as follows:
Desired output looks like this.
Assuming data is as follows
then try the following code
Sub Demo()
With ThisWorkbook.Worksheets("Sheet7") 'change Sheet7 to your data sheet
.Range("A1:B23").Cells.SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp
End With
End Sub
Change range as per your data. This will give result as