As stated in the title, if the data is not very wide, the code below will work.
If the A1 cell contains an IMPORTRANGE formula,
By taking the value of all cells from there and setting it to
A1 cells become values and all other cells remain.
const values=sheet.getRange(
1,1, sheet.getLastRow(), sheet.getLastColumn()
) .getValues();
sheet.getRange(
1,1, sheet.getLastRow(), sheet.getLastColumn()
.setValues(values);
However, if it becomes a larger seat, it gets stuck in the 6 minute limit in the middle of setValues. All of the data will no longer remain in the cell.
Keep everything you can get from the IMPORTRANGE formula for A1 cells at faster or easier GAS.
Is it possible to erase the formula for A1 cells?
If you simply leave the A1 cell blank, of course all the values that IMPORTRANGE had will disappear.
I look forward to your kind cooperation.
google-apps-script google-spreadsheet
Self-resolved.
SetValues is surprisingly slow and times out if it's tens of thousands of rows. The process was completed in a few minutes by doing the following:
In this way, what was displayed in IMPORTRANGE can be retrieved as a value by IMPORTRANGE.
This will take about 2,3,4 minutes, but it's done within the operating range.
If there is a better way, I would appreciate it if you could write it down.I look forward to your kind cooperation.
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
581 PHP ssh2_scp_send fails to send files as intended
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.