I'm sure this has been brought up before, but I need to remove blank cells from columns and
consolidate the remaining ones at the top. The attachment has is an example of the unfixed
columns.
Thanks as always.
I'm sure this has been brought up before, but I need to remove blank cells from columns and
consolidate the remaining ones at the top. The attachment has is an example of the unfixed
columns.
Thanks as always.
Hi
Try this code:
RegardsSub delblanks()
Dim r As Long, cnt As Integer
r = Sheets("sheet1").Range("A" & Rows.Count).End(xlUp).Row
cnt = 1
For i = 2 To r
If Sheets("sheet1").Range("A" & i).Value = "" And Sheets("sheet1").Range("B" & i).Value = "" Then
Sheets("sheet1").Rows(i & ":" & i).Delete
i = i - 1
cnt = cnt + 1
End If
If cnt > r Then
Exit For
End If
Next
End Sub
Click *, if my suggestion helps you. Have a good day!!
Thanks for the code. However, I'm not sophisticated enough to know how to use it.
Would you please be so kind as to enlighten me.
Hook
Hook,
Looking at your example file, why don't you just use a sort on LLNAME? Here's how:
- Select columns A and B
- Go to the Data tab on the ribbon
- Click the big Sort button
- Check "My data has headers"
- In the Sort By, select LLName
- Click OK
Attached are screenshots showing the instruction steps and sort results.
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
Hey tigeravatar,
That's way too simple. I wanted something high powered and complicated.
And am I ever embarrased.
Thanks much.
Hook
You're very welcome
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks