+ Reply to Thread
Results 1 to 6 of 6

delete empty cell and zero value cell and shfit up

  1. #1
    Registered User
    Join Date
    08-19-2010
    Location
    jersey
    MS-Off Ver
    Excel 2007
    Posts
    49

    delete empty cell and zero value cell and shfit up

    hi
    i have a data in cloumn E , within the data i have empty cells and zero values
    could any one help in a macro that delete the empty and zero values cells and shift the cells up and copy the result to column i
    thanks
    Please Login or Register  to view this content.
    Last edited by abdi1; 09-19-2010 at 10:41 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: delete empty cell and zero value cell and shfit up

    Hi abdi1
    welcome to the forum
    something like...
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    08-19-2010
    Location
    jersey
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: delete empty cell and zero value cell and shfit up

    hi
    thanks for ur help
    iv tried ur code but it seem that somthing is wrong

    below is an attached copy of excel sheet including an example of my numbers
    could u plz tray the code again on my excel sheet
    thanks
    Attached Files Attached Files

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: delete empty cell and zero value cell and shfit up

    hey abdi1,
    Should have tested it first but This will..
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: delete empty cell and zero value cell and shfit up

    Just copy and paste the code to your excel workbook

    Option Explicit
    Dim LR As Long

    Sub test()

    Dim i As Long

    LR = Cells(Rows.Count, 5).End(xlUp).Row

    For i = LR To 1 Step -1
    If IsEmpty(Cells(i, 5)) = True Then
    Cells(i, 5).EntireRow.Delete shift:=xlUp
    End If
    Next i

    LR = Cells(Rows.Count, 5).End(xlUp).Row
    Range("E1:E" & LR).Copy Range("i1")


    End Sub

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: delete empty cell and zero value cell and shfit up

    Hi JieJenn
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

+ 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