Corey,
Where you see it says "For j = 2 To 10", change the 2 to a 5. This will start at column E (5) and go to J (10), if you need it to go farther then J, enter a bigger number then 10. So it should end up like this:
For j = 5 To 10. That should do it. Glad it works.
Ryan
For j = 2 To 10 If Cells(i, j).Value = "" Then Cells(i, j).Delete Shift:=xlToLeft If Cells(i, j).Offset(0, 1).Value <> "" Then j = j - 1 End If Next j i = i + 1
worked great! Being an Excel novic, how would I start say at Column 5, row 2?
Corey,
Here is code that will take care of your needs. It starts in Row 2 and Column B and goes over 10 Columns. If you need more columns, you can change the 10. This code assumes that there are no blank rows between names. It was working fine for me. Hope it works for you. Let me know.
Ryan
Sub MoveNumbers()
Dim i As Integer
Dim j As Integer
Application.ScreenUpdating = False
i = 2
j = 2
Do While Cells(i, 1).Value <> ""
For j = 2 To 10
If Cells(i, j).Value = "" Then
Cells(i, j).Delete Shift:=xlToLeft
If Cells(i, j).Offset(0, 1).Value <> "" Then j = j - 1
End If
Next j
i = i + 1
Loop
Application.ScreenUpdating = True
End Sub