Hello fellow users. I got a problem that i need solve, as fast as possible. I need to remove cells from A2 to A1000 which does not contain number at first character.
I got this vba file already, that remove empty rows, but i still need some code to remove rows without number first.
My A1 row is name which i dont want to be deleted.
A2 row is 1234567-1
A3 has -
A4 has 1234567-2
etc etc
Here is that i use:
Option Explicit
Sub RemoveEmptyRows()
Dim i As Long
Dim DelRange As Range
On Error GoTo Whoa
Application.ScreenUpdating = False
For i = 1 To 50
If Application.WorksheetFunction.CountA(Range("A" & i & ":" & "Z" & i)) = 0 Then
If DelRange Is Nothing Then
Set DelRange = Rows(i)
Else
Set DelRange = Union(DelRange, Rows(i))
End If
End If
Next i
If Not DelRange Is Nothing Then DelRange.Delete shift:=xlUp
LetsContinue:
Application.ScreenUpdating = True
Exit Sub
Whoa:
MsgBox Err.Description
Resume LetsContinue
End Sub
BR
Aletzi1
Bookmarks