Skip to content

Instantly share code, notes, and snippets.

@henryscala
Created November 27, 2014 01:53
Show Gist options
  • Save henryscala/7ed0cd0a33439bf8c68a to your computer and use it in GitHub Desktop.
Save henryscala/7ed0cd0a33439bf8c68a to your computer and use it in GitHub Desktop.
vba functions
Sub squeezeRow(column, startRow, endRow As Integer)
Dim count As Integer
count = 0
i = startRow
Do While i <= endRow
If Cells(i, column).Value = "" Then
For j = i + 1 To endRow
Cells(j - 1, column).Value = Cells(j, column).Value
Next
Cells(endRow, column) = ""
endRow = endRow - 1
Else
i = i + 1
End If
Loop
End Sub
Sub run()
Call squeezeRow(7, 21, 26)
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment