0

Looking to create a button that will move my closing inventory counts into the opening inventory counts of a new week, while also clearing out the inputted counts. Basically resetting the spreadsheet for a new week.

I will apologize as I have no idea what I am doing, I have tried googling how and what to do in these incidents and have been self-taught for the most part, but this time I am in over my head and need help. This is for a liquor inventory program I've had to build for the bar where I work.

Currently, I have to highlight and delete the inputted data in a new week and then copy and paste my closing numbers into the opening numbers. I know there is a way to do what I want so that its just one button to reset the new sheet without deleting the formulas. Formulas are not currently protected but will be once I let other managers use the program

I do not have any code written for it as I have no idea where to even start to create a code

Any help with this will be greatly appreciated

player0
  • 124,011
  • 12
  • 67
  • 124
Regg
  • 1
  • 2

1 Answers1

0

you may need something like this connected to Drawing which will act like button:

function moveValuesOnly() { var ss = SpreadsheetApp.getActiveSpreadsheet();
                            var source = ss.getRange("Sheet2!C1");
                            source.copyTo(ss.getRange("Sheet1!B1"), {contentsOnly: true}); 
                            source.copyTo(ss.getRange("Sheet1!B2"), {contentsOnly: true});
                            source.copyTo(ss.getRange("Sheet1!B7"), {contentsOnly: true});
                            source.copyTo(ss.getRange("Sheet1!B8"), {contentsOnly: true});
                            source.copyTo(ss.getRange("Sheet1!B11"), {contentsOnly: true});
                            source.copyTo(ss.getRange("Sheet1!B12"), {contentsOnly: true});
                            source.copyTo(ss.getRange("Sheet1!B13"), {contentsOnly: true});}
player0
  • 124,011
  • 12
  • 67
  • 124
  • Thanks I will try this but one question .... how do I do that? I have no experience and have no idea what im doing with this one. – Regg May 20 '19 at 22:55
  • first you need to add this script. here is a tutorial: https://stackoverflow.com/a/54797718/5632629 and then just link it to the drawing button – player0 May 20 '19 at 23:01
  • Hi Player0, I tried this and i cant get it to work. Sorry. I did manage to build the code and get it all working on Excel but I need it to work in Google Sheets also. If I sent you the excel code and have a look at it and let me know where to fix my mistakes? – Regg May 23 '19 at 06:59