Nice video. I was just wondering on the last row part, why not just take out the 19 all together as that will go to the last row itself instead of adding more code (At least for this example)? (example: ('A6:C')
The following AppsScript inserts a new row above row 12 and copies the formula from row 13 and pastes in the new row 11 that was created for Sheet 1 & Sheet 2, you can modify the section "var tabs =[ ]" to include all the sheets where you need your script to be executed taking care to use the correct sheet names. The rest of the sheets in the spreadsheet remain unaffected. function addNewRow() { var tabs = [ 'Sheet 1', 'Sheet 2', ]; var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); for (var i = 0; i < tabs.length; i++) { spreadsheet.setActiveSheet(spreadsheet.getSheetByName(tabs[i]), true); spreadsheet.getRange('12:12').activate(); spreadsheet.getActiveSheet().insertRowsBefore(spreadsheet.getActiveRange().getRow(), 1); spreadsheet.getActiveRange().offset(0, 0, 1, spreadsheet.getActiveRange().getNumColumns()).activate(); spreadsheet.setActiveSheet(spreadsheet.getSheetByName(tabs[i]), true); spreadsheet.getRange('13:13').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_NORMAL, false); } } Hope this helps. Of course you need to modify the rest of the script to suit your requirement. Let me know if it works for you.
i cant figure out a way to add a macro to all my other spreadsheets can u help me with that? so i get a repeated dataset everyday but each in a new sheet so how do i add that macro to all my other sheets?
Thank you so much, just wanna ask, what if, you only want selected sheets to be part of your loop macros? Instead of (var allsheets) what should I put? Looking forward for your reply ☺️🙏
Given that selecting several sheets was recently introduced, I don't think it made it as a part of Apps Script API yet. So as far as I know, at the moment you can only get the sheet which is currently active & that's it.
sir i'm trying to record macro in google sheets. But while recording it showing "activating previous sheet" rather than activating named sheet. and paste data anywhere without any command.kindly make latest video to solve my problem to record macro in google sheets 🙏🙏🙏🙏🙏🙏🙏🙏🙏
Thanks! Your videos have made my new business so much ease!
Brilliant!!! Can't thank you enough! You just saved me a lot of time!
Thank you very much. This is exactly what I was looking for and it worked like magic.
Great to hear!
This is brilliant. WYSIWYG then code editing. No more or way less looking around online for syntax tips.
Thank you very much
Nice video. I was just wondering on the last row part, why not just take out the 19 all together as that will go to the last row itself instead of adding more code (At least for this example)? (example: ('A6:C')
awesome! just one thing i would ask. how about if more sheets to be excluded?
exactly
YOU SOLVE MY WHOLT PROBLEM THANKS
Thank you!!!
Thanks a lot. It would be great if the code should start the loop from the current active sheet, it would be easier to use it anywhere
Hi, this is the lesson I've been looking for! How do we exclude more worksheets?
The following AppsScript inserts a new row above row 12 and copies the formula from row 13 and pastes in the new row 11 that was created for Sheet 1 & Sheet 2, you can modify the section "var tabs =[ ]" to include all the sheets where you need your script to be executed taking care to use the correct sheet names. The rest of the sheets in the spreadsheet remain unaffected.
function addNewRow() {
var tabs = [
'Sheet 1',
'Sheet 2',
];
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
for (var i = 0; i < tabs.length; i++) {
spreadsheet.setActiveSheet(spreadsheet.getSheetByName(tabs[i]), true);
spreadsheet.getRange('12:12').activate();
spreadsheet.getActiveSheet().insertRowsBefore(spreadsheet.getActiveRange().getRow(), 1);
spreadsheet.getActiveRange().offset(0, 0, 1, spreadsheet.getActiveRange().getNumColumns()).activate();
spreadsheet.setActiveSheet(spreadsheet.getSheetByName(tabs[i]), true);
spreadsheet.getRange('13:13').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_NORMAL, false);
}
}
Hope this helps. Of course you need to modify the rest of the script to suit your requirement. Let me know if it works for you.
hi, is there a way to apply the macro to a listed sheet name? thanks
Nice
i cant figure out a way to add a macro to all my other spreadsheets can u help me with that?
so i get a repeated dataset everyday but each in a new sheet so how do i add that macro to all my other sheets?
Hello I've done what you show in the video but it doesnt want to skip the sheet I've selected to not execute the macro on it
What's your code?
@@ExcelGoogleSheets
Thank you for your quick response
I just forget to put the () on a function 👍
👍
You are great
Thank you so much, just wanna ask, what if, you only want selected sheets to be part of your loop macros? Instead of (var allsheets) what should I put? Looking forward for your reply ☺️🙏
Given that selecting several sheets was recently introduced, I don't think it made it as a part of Apps Script API yet. So as far as I know, at the moment you can only get the sheet which is currently active & that's it.
I would use the logic in this video with checkboxes as a workaround ruclips.net/video/P0L2K7AXufw/видео.html
Thank you for response
Excelent!!
Thank you
Can you use the same script to the new worksheet?
yes
Google sheets seems more amazing than Excel by using JavaScript instead of VBA
in what way?
Microsoft is well aware of this which is why they are trying to push everyone off of VBA to their own version of Javascript (typeScript).
@@amitk2784 not as compatable. Particularly on web and mobile phones.
@@srider33 typescript is not intended for what you said. It's for a different purpose .
sir i'm trying to record macro in google sheets. But while recording it showing "activating previous sheet" rather than activating named sheet. and paste data anywhere without any command.kindly make latest video to solve my problem to record macro in google sheets
🙏🙏🙏🙏🙏🙏🙏🙏🙏
good
Thanks
How can i ignore multiple sheets with this your formula, this is urgent, thank you