Results 1 to 3 of 3

Thread: Copy data from sheet1 and to new work book then to delete value 0 appearing in col e

  1. #1

    Copy data from sheet1 and to new work book then to delete value 0 appearing in col e

    Register for a FREE account, and/
    or Log in to avoid these ads!


    i have got this workbook rohan and in sheet1 i have got data from cell a1 to n500

    i wanted to know if its possible to to have a code which Copy data from sheet1 in workbook rohan to a new work book and then to delete value 0 appearing in the entire column e (there can be gaps in column e and the value 0 can appear anywhere in the column e) in the new workbook

    The values 0 in column e in workbook rohan should be intact and not to be deleted.

    Could you please help me on the code many many thanks

  2. #2
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Excel Version
    this might do it (works on the active sheet):
    Sub blah()
    ActiveSheet.UsedRange.AutoFilter Field:=5, Criteria1:="0"
    With ActiveSheet.Range("_filterdatabase")
      .Offset(1).Delete xlShiftUp
    End With
    End Sub

  3. #3
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Nanaimo, BC, Canada
    Blog Entries
    Excel Version
    Excel Office 365 Insider
    Cross posted at MrExcel:, please have a read of this article:
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: -||- Blog: -||- Forums:
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

Posting Permissions

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