+ Reply to Thread
Results 1 to 3 of 3

Arrange column after delete

Hybrid View

  1. #1
    Gil
    Guest

    Arrange column after delete

    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. #2
    And1
    Guest

    Re: 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.
    >


  3. #3
    Gil
    Guest

    Re: Arrange column after delete

    Thank you very much for your help.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1