Google sheet query

mbmc

New Member
Joined
Apr 26, 2024
Messages
1
Office Version
  1. Prefer Not To Say
Platform
  1. Mobile
In Google sheets I want that if I enter data to b1 it gets added to a1 and after adding b1 turns blank again to enter more data. For example if a1 is 100 and if I enter 10 in b1 then a1 becomes 110 and b1 becomes blank for more data how can I do that please help ?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
IN Sheets, Click on Extensions, click on Apps Script. The next screen will show a blank function, delete it and replace with the code below. Click 'Save' (looks like a floppy disc) if successful Run, Debug etc will nolonger be greyed out.

JavaScript:
function onEdit(e) {
  const rangeEdited=e.range;
  var editSheet=e.range.getSheet().getName();
  var editColumn=rangeEdited.getColumn();
  var editRow=rangeEdited.getRow();
  if (editRow==2 && editColumn==1){
    rangeEdited.offset(-1, 0).setValue(rangeEdited.offset(-1,0).getValue()+rangeEdited.getValue());
    rangeEdited.setValue("");
  }
}
 
Upvote 0

Forum statistics

Threads
1,223,276
Messages
6,171,138
Members
452,381
Latest member
Nova88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top