+ Reply to Thread
Results 1 to 14 of 14

Export Rows based on value in column. Delete Row in current doc.

  1. #1
    Registered User
    Join Date
    12-18-2012
    Location
    Bournemouth, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Export Rows based on value in column. Delete Row in current doc.

    Fairly new to VBA, sure this is probably quite simple!

    I have a data file where column AF on sheet1 contains a reference.
    I need to export all records where value is "CBL" and delete from current worksheet.
    Can I use current macro in new worksheet to append 3 columns of lookup data and save as etc?

    Thanks in advance.
    Dave

  2. #2
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Export Rows based on value in column. Delete Row in current doc.

    Hi,

    Welcome to the Excel Forum.

    Could u please provide example workbook bcz its more easy to resolve ur query.

  3. #3
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Export Rows based on value in column. Delete Row in current doc.

    Hi,

    Welcome to the Excel Forum.

    Could u please provide example workbook bcz its more easy to resolve ur query.

  4. #4
    Registered User
    Join Date
    12-18-2012
    Location
    Bournemouth, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Export Rows based on value in column. Delete Row in current doc.

    Hi Naveed

    Please see attached. Personal data removed hence blank columns of data. This data would be in my xlsm file with other columns appended etc. Record numbers vary 10k-25k

    Thanks
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Export Rows based on value in column. Delete Row in current doc.

    This workbook contain only 1 tab where u want to move the CBL data in new tab in this current worksheet or else u want to move to new workbook.

  6. #6
    Registered User
    Join Date
    12-18-2012
    Location
    Bournemouth, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Export Rows based on value in column. Delete Row in current doc.

    Hi

    Move to new workbook as CBL.xlsx or CBL.txt (tab delimited).

    Thanks

  7. #7
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Export Rows based on value in column. Delete Row in current doc.

    plz have review the attached workbook and let me know if u hv any question
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-18-2012
    Location
    Bournemouth, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Export Rows based on value in column. Delete Row in current doc.

    Hi

    Export works perfectly, can the CBL rows in Original Macro file be deleted or autofilter turned off so I can run a delete row script?

    Thanks

  9. #9
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Export Rows based on value in column. Delete Row in current doc.

    Hi,

    I have updated the macro and now have review and let me know if u have any question.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    12-18-2012
    Location
    Bournemouth, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Export Rows based on value in column. Delete Row in current doc.

    That's great thanks.

  11. #11
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Export Rows based on value in column. Delete Row in current doc.

    k good anythng else u want frm my side

  12. #12
    Registered User
    Join Date
    12-18-2012
    Location
    Bournemouth, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Export Rows based on value in column. Delete Row in current doc.

    I don't think so it seems to work great so just need to put into my Master macro.

    Thanks again.
    Dave

  13. #13
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Export Rows based on value in column. Delete Row in current doc.

    i didn't get u

    macro will save in xlsm format only if u r copying macro to another workbook and that workbook format is xlsx then macro will not work.

  14. #14
    Registered User
    Join Date
    12-18-2012
    Location
    Bournemouth, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Export Rows based on value in column. Delete Row in current doc.

    That's ok. Now the autofilter is reset I can run a script to remove rows containing "CBL".
    Is it easy to change the save as to csv? If so I can import again to make my changes.

+ 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