+ Reply to Thread
Results 1 to 9 of 9

Teething problems with archive macro

  1. #1
    Registered User
    Join Date
    11-21-2014
    Location
    peterborough
    MS-Off Ver
    2010
    Posts
    16

    Teething problems with archive macro

    Hi Guys

    I found this on another forum and it works great
    Please Login or Register  to view this content.
    Is there any way at clear contents that it leaves the first two columns and deletes the remaining?
    At the moment it clears the whole archived selection including my location tags.

    Thanks
    Andy

  2. #2
    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
    44,674

    Re: Teething problems with archive macro

    Maybe, untested:
    Please Login or Register  to view this content.
    Why do you copy the data twice?

    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


  3. #3
    Registered User
    Join Date
    11-21-2014
    Location
    peterborough
    MS-Off Ver
    2010
    Posts
    16

    Re: Teething problems with archive macro

    Hi TMS,

    Thanks for your reply.

    I have tried what you suggested but recieve a run time error: "1004 - Application-defined or object defined error" and highlights the line you suggested.
    I do not understand how the code works so have no idea about copying twice?

    Andy

  4. #4
    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
    44,674

    Re: Teething problems with archive macro

    Suggest you post a sample workbook then and mock up what you hope to see after the macro has run.

    Regards, TMS

  5. #5
    Registered User
    Join Date
    11-21-2014
    Location
    peterborough
    MS-Off Ver
    2010
    Posts
    16

    Re: Teething problems with archive macro

    Quote Originally Posted by TMS View Post
    Suggest you post a sample workbook then and mock up what you hope to see after the macro has run.

    Regards, TMS
    Hi TMS,

    I've created and attached an example document.

    Thank you in advance for any help.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    863

    Re: Teething problems with archive macro

    Hi there!

    Maybe if you replace .ClearContents with:
    Please Login or Register  to view this content.
    oh and as TMS well said, get rid of that .Copy before the .Copy Destination... line.
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Teething problems with archive macro

    Maybe this....

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  8. #8
    Registered User
    Join Date
    11-21-2014
    Location
    peterborough
    MS-Off Ver
    2010
    Posts
    16

    Re: Teething problems with archive macro

    Quote Originally Posted by bulina2k View Post
    Hi there!

    Maybe if you replace .ClearContents with:
    Please Login or Register  to view this content.
    oh and as TMS well said, get rid of that .Copy before the .Copy Destination... line.
    Thank you all, this solution worked!

  9. #9
    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
    44,674

    Re: Teething problems with archive macro

    You're welcome. Thanks for the rep.

    Credit to bulina2k for the final solution

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Auto Archive & Drop Down Macro Query
    By andy_marcos in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-15-2013, 04:25 PM
  2. [SOLVED] Macro to replace values in an archive tab
    By CheyM in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2013, 12:37 PM
  3. Autoclosing an idle workbook on a locked workstation. Teething problems.
    By Davius in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-20-2012, 04:48 AM
  4. Macro to retrive data for a quote that is in archive
    By marianov in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2012, 08:41 AM
  5. [SOLVED] problems to open an excel archive
    By spaniard-in-trouble in forum Excel General
    Replies: 1
    Last Post: 03-30-2006, 06:50 PM
  6. Excel97 macro to archive Outlook mailbox
    By Geo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-21-2005, 05:05 AM

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