+ Reply to Thread
Results 1 to 11 of 11

Issue with Copying data to a New Sheet After Filtering.

  1. #1
    Registered User
    Join Date
    09-14-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    6

    Issue with Copying data to a New Sheet After Filtering.

    Hi All,

    Am facing a Strange issue.I have a ".CSV" File and I Have to Filter the data With a criteria and Copy the Filtered Data into a New sheet.

    I have changed the File extension to ".xls" and written the code but stangely it works only once.If i close and reopen the file it does not One more obervation is that When i Saved the File with ".xlsm" format the code works fine.
    But my requirement is to have ".xls" extension. Am attaching the file as well ,based on the customer codes provided by end user in " Meta Data " Sheet am filtering and copying into "Filtered data" sheet.

    Kindly help me in Resolving this issue.

    Many Thanks,
    Aparna.
    Attached Files Attached Files

  2. #2
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Issue with Copying data to a New Sheet After Filtering.

    I'll take a look at it tomorrow.
    Can't now anymore

    but if you want a macro to do the autofiltering then youre extention will be .xlsm not .xlsx

  3. #3
    Registered User
    Join Date
    09-14-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Issue with Copying data to a New Sheet After Filtering.

    Okay Thank you so much denis

  4. #4
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Issue with Copying data to a New Sheet After Filtering.

    So as I said yesterday. If you want a macro to run your filter the file will have the ".xlsm" extention. the m stands for macros.

    I don't think it's possible to save it as .xls for the macro to work.

    But I could be wrong. Maby someone else knows.

  5. #5
    Registered User
    Join Date
    09-14-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Issue with Copying data to a New Sheet After Filtering.

    Okay....
    But this same code worked in .xls formatted file as well...
    Let see even am searching for the solution ..

    Many Thanks,
    Aparna

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Issue with Copying data to a New Sheet After Filtering.

    xls files can run macros (xlsx files cannot) otherwise macros would not work in xl2003 and earlier versions ;-)
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  7. #7
    Registered User
    Join Date
    09-14-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Issue with Copying data to a New Sheet After Filtering.

    Exactly, ".xls" supports Macros.But I wonder When I just Reeopen the same file and ru IT DOes not Copy the Filtered content As the Object "rng2" in mY Code returns "NULL".If you can Just assist me Where the error is ,it would be highly Appreciated

    Many Thanks,
    Aparna

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Issue with Copying data to a New Sheet After Filtering.

    your sample workbook works for me in repeated tests

  9. #9
    Registered User
    Join Date
    09-14-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Issue with Copying data to a New Sheet After Filtering.

    Is it ?????thanks.There must be some problem in the file data....Then.
    Still Am getting the issue Okay ...
    Let me give a final try and let you know

    Thanks Buddy,
    Aparna.

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,102

    Re: Issue with Copying data to a New Sheet After Filtering.

    The .xls extension runs fine for me in both Excel 2003 and Excel 2007.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  11. #11
    Registered User
    Join Date
    09-14-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Issue with Copying data to a New Sheet After Filtering.

    Thank you all ,There is issue with data in the file got resolved....

+ 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