+ Reply to Thread
Results 1 to 7 of 7

Help with code to creat Reset button to clear cells and copy back the original formula

  1. #1
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Help with code to creat Reset button to clear cells and copy back the original formula

    Hi All

    I urgently need help with the follwoing:

    I have a spreadsheet which lets a user to input values in a range of cells (d10:d100) to see what happens to the overall scores will be depending on the user input.

    Currently D10:D100 conatins VLOOKUP formulas which takes the current scores from the sheet. What I need to do is allow users to input what they need in D10:d100 and after they finish looking at various possible scores then they hit on a command button which clears the contents of the d10:d100 and have the original formula (vlookup) copied in the same range i.e. user sees the original scores before any modifications.

    I have attcahed a simple spreadsheet to demonstrate what I need to do. in Sheet 2 the vlaues are copied from Sheet1. User can only input data which they wnat in cells C5:C9 to see what score they would have achieved if the Actual Scores were different.

    The I want to crate a Command Button to clear the contents of c5:c9 and have the original values (recopy the original formula i.i. the vlookup formulas to obtain the scores from sheet1) back in the cells.

    In the actual spreadsheet every other column is locked so user can only change the actual scores in clolumn C.

    I really need this urgently before Tuesday and any help is much appreciate it


    Any urgent help is apprecaite it.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Help with code to creat Reset button to clear cells and copy back the original formula

    Try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Help with code to creat Reset button to clear cells and copy back the original formula

    This works perfectlty. Is it possible to let the code know to only copy the formula down to the last cell which contains data in B column , i.e. whenever it see total in Column B then only copy the formula upto that point in col c. This is because I have varuois sheets with various column lenghts.

    therwise this is brilliant and thank you for your help

  4. #4
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Help with code to creat Reset button to clear cells and copy back the original formula

    ALternativel when I add the following
    Please Login or Register  to view this content.
    I get the follwoing error
    Run Time 1004 Application error or Object Defined Error

    Any suggestions?
    Last edited by rv02; 07-30-2015 at 02:01 PM. Reason: Mis Type

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Help with code to creat Reset button to clear cells and copy back the original formula

    Try this
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Help with code to creat Reset button to clear cells and copy back the original formula

    Brillaint , it works great.

    Thank you so much

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Help with code to creat Reset button to clear cells and copy back the original formula

    You're welcome. Glad I can help
    Thanks for the feedback.
    Regards

+ 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. [SOLVED] Reset button to set all data to original settings
    By jungleskipper1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-01-2015, 10:18 PM
  2. [SOLVED] Userform button action - clear,copy paste and print crashes. Please help with code
    By intex in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-05-2014, 12:16 PM
  3. Replies: 0
    Last Post: 06-28-2014, 02:26 PM
  4. Help: Reset input data back to original
    By jasonj427 in forum Excel General
    Replies: 5
    Last Post: 01-22-2013, 01:49 AM
  5. Macro to copy Dyanmic lists then copy sheet and clear the original data
    By twiggywales in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2012, 01:06 PM
  6. How to when deselecting my radio button list and my excel goes back to original ?
    By achill3s in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2011, 05:49 AM
  7. code to move cells back to thier original location
    By twofootgiant in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-28-2011, 07:32 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