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!

    hI,

    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
    Posts
    1,478
    Articles
    0
    Excel Version
    365
    this might do it (works on the active sheet):
    Code:
    Sub blah()
    ActiveSheet.Copy
    ActiveSheet.UsedRange.AutoFilter Field:=5, Criteria1:="0"
    With ActiveSheet.Range("_filterdatabase")
      .Offset(1).Delete xlShiftUp
      .AutoFilter
    End With
    End Sub

  3. #3
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,267
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    Cross posted at MrExcel: http://www.mrexcel.com/forum/excel-q...ns.htmlRohan85, please have a read of this article: http://www.excelguru.ca/content.php?184
    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: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/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
  •