Delete All Empty Cells @mbgeotech
Delete All Empty Cells  @mbgeotech
Uploaded November 2024 | Updated November 2026, 2 hours ago
Delete All Empty Cells.
This is the code:
Sub DeleteEmptyCells()
Dim ws As Worksheet
Dim lastRow As Long
Dim col As Range
Dim cell As Range

' Set the worksheet you want to work on
Set ws = ThisWorkbook.Sheets("Sheet2") ' Change "Sheet1" to your sheet name

' Loop through columns A, B, and C
For Each col In ws.Range("A:C").Columns
' Find the last row in each column
lastRow = ws.Cells(ws.Rows.Count, col.Column).End(xlUp).Row

' Loop through each cell in the column from bottom to top
For Each cell In ws.Range(col.Cells(1, 1), col.Cells(lastRow, 1)).Cells
' Check if the cell is empty
If IsEmpty(cell.Value) Then
' Delete the cell and shift up
cell.Delete Shift:=xlUp
End If
Next cell
Next col

End Sub
Delete All Empty CellsBaseline Correction | DEEPSOILWater Table Statistics | Slide2Report of the Expert Panel on the Technical Causes of the Failure of Feijão Dam.Immediate Settlement | SETTLE 3D RocscienceTiki eating dinnerAnchorage, Alaska, USA, 2Determine Shear Strength and PWP Data from SLIDEPlot Data from DEEPSOIL using MATLABPortage glacier cruise, Alaska, USAWSliq | Part 2: Liquefaction Initiation Performance-BasedEstimate Bearing Capacity using RS2
MB GeoTech |

Delete All Empty Cells

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER