View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
And1 And1 is offline
external usenet poster
 
Posts: 20
Default Arrange column after delete

I guess, that names are in column "B".

Try this:
Private Sub CommandButton1_Click()
For Each cell In Range("B1:B10")
If cell.Value = "" Then cell.Delete Shift:=xlUp
Next cell
End Sub

Kind Regards,
Andrzej

Gil napisaƂ(a):
Hello,

I have a worksheet with data:

SerialNumber Name
1 Dan
2 Joe
3 Kelvin
4
5
6
7
8
9
10

My user sometimes delete one name, for example:
1
2 Joe
3 Kelvin
4
5
6
7
8
9
10

I want to write a macro that will shift the remaining names up:

1 Joe
2 Kelvin
3
4
5
6
7
8
9
10

How can I do this ?

Thank you
Gil D.