+ Reply to Thread
Results 1 to 4 of 4

VBA code problem copying saving workbook

  1. #1
    Registered User
    Join Date
    10-05-2012
    Location
    Gainsborough, England
    MS-Off Ver
    Office 2016 & Office 365
    Posts
    87

    VBA code problem copying saving workbook

    Hi
    Great forum, I am very new to Excel let alone VBA, below is a piece of code I have been workeng on, sure most can see what it does, click the command button it then makes a copy of the workbook into a different location and clears the contents of cells, What i am struggling with is..I want it to clear the contents in the original workbook not the new saved one, so in other words the backup copy keeps the data and the original clears ready for another time....sorry if this is stupid or wrong, maybe easy to some...I am i making any sense???


    Please Login or Register  to view this content.
    Last edited by jet2004uk; 10-10-2012 at 09:46 AM. Reason: Added code tags for new users

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Very new to Excel even newer to VBA

    Just refer to the original workbook when you do the clear:

    Please Login or Register  to view this content.
    Gary's Student

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Very new to Excel even newer to VBA

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    HTH
    Regards, Jeff

  4. #4
    Registered User
    Join Date
    10-05-2012
    Location
    Gainsborough, England
    MS-Off Ver
    Office 2016 & Office 365
    Posts
    87

    Re: Very new to Excel even newer to VBA

    Jakobshavn thanks for your quick response

    I am now getting an error msg "Run time error 438 object doesnt support this propert or method" seems to point towards -wb.Range("A7:Q20").ClearContents

    Any ideas??
    Thanx
    John

+ 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