Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much for your help.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro To Delete/Add & Rename/Arrange Sheets | Excel Discussion (Misc queries) | |||
How do I re-arrange numbers in a column? | Excel Discussion (Misc queries) | |||
How do you arrange text alphabetically in a column? | New Users to Excel | |||
Import csv files, delete rows, arrange columns .... | Excel Programming | |||
how do i arrange column A (last name) in alphabetical order? t. | Excel Discussion (Misc queries) |