office scripts
492 TopicsDisappearing Script Button
In the online version of excel, I have a script button keeps disappearing. This same button is fine on desktop and I don't believe this was a problem before. When I load the page it isn't there. I found that if I added another button on another sheet in that workbook, that when I switch to that sheet and then I return to the first sheet the button returns, but if I refresh the page again, the button disappears. If I switch to a tab without a script button then the button does not return. i have tried minimizing the browser, changing zoom levels, scrolling and such but the only thing I have found to make the button re-appear is switching to another sheet that has a script button on it (I created a 'dummy button' on that sheet). I don't know why this button that I need disappears while that 'dummy' button I put on the other tab doesn't disappear and I don't know why having that other button makes it reappear by just switching to that tab and back. a) has anyone else experienced any problem like this? b) does anyone have any ideas to try or why it is happening? thank you.Solved67Views0likes4CommentsMoving a column of text data into 3 columns of data?
I have a column of text data cells 1,2,3,4,5,6,7,8,9 and longer. I want to create 3 column of data to graph and manipulate Cell in Columns. 1,2,3 3,4,5 5,6,7 8,9,10 and longer. So i need to create 3 columns of data from 1 column of data. I am using Mac Excel 16 and I can not make this happen. I have tried all sorts of solutions. Help? Thank you,127Views0likes4CommentsUnprotect in Office Scripts
I am writing an office script that requires sorting on a sheet with the overall sheet protected and specific cells not protected. I need to be able to sort an unprotected range using an automation but the protection is restricting it even though I have "sort" allowed in the protection options. Is there a way to unprotect and then re-protect the sheet as part of the scripts? Including passwords? function main(workbook: ExcelScript.Workbook) { let selectedSheet = workbook.getActiveWorksheet(); // Clear auto filter on selectedSheet selectedSheet.getAutoFilter().clearCriteria(); // Custom sort on range range C9:I6001 on selectedSheet selectedSheet.getRange("C9:I6001").getSort().apply([{key: 0, ascending: true}], false, true, ExcelScript.SortOrientation.rows); // Apply values filter on selectedSheet selectedSheet.getAutoFilter().apply(selectedSheet.getAutoFilter().getRange(), 6, { filterOn: ExcelScript.FilterOn.values, values: ["1"] }); }61Views0likes1CommentUsing mode with several criteria
Hello everyone! I'm currently treating some data before I send it to do some machine learning. I have the following data: id Ano mês data_inversa dia_semana horario uf br km municipio causa_acidente tipo_acidente classificacao_acidente fase_dia sentido_via condicao_metereologica tipo_pista tracado_via uso_solo ano pessoas mortos feridos_leves feridos_graves ilesos ignorados feridos veiculos And I created a new table to summarize this data for months instead of accidents, here are the columns: BR KM Ano Mês Clima (Moda) Tipo Pista Acidentes Veículos Ilesos Feridos Leves Feridos Graves Mortes Causa (Moda) Risco What I want to do is calculate the mode of condicao_metereologica for each combination of BR, KM, Ano and Mês. But I can't wrap my head around on how I could do this. Any help is appreciated! Let me know if I made anything not as clear as it is in my head xD86Views0likes1CommentScript changing dates to text
I"m trying to make a script to transform a column with dates to text. Normally i would just use the TEXT function but the issue is that the new text values need to replace the old date values. The dates are now in three columns with the number notation date and it needs to be a text with the form "dd/mm/yyyy". Since i need to do this for at least 50 files i tought about using a script to make a new column & use the text funcion to get the new values for all three columns Change the date notation on the new values to text copy the new text values to the old column Delete the new column. The issue i meet is at the second stap that the values are in a table and are not all the same length. At the moment i have this for first step in a script function main(workbook: ExcelScript.Workbook) { let selectedSheet = workbook.getActiveWorksheet(); // Insert at range E:E on selectedSheet, move existing cells right selectedSheet.getRange("E:E").insert(ExcelScript.InsertShiftDirection.right); // Set range E2 on selectedSheet selectedSheet.getRange("E2").setFormula("=TEXT([@Geboortedatum],\"dd/mm/jjjj\")"); // Insert at range Q:Q on selectedSheet, move existing cells right selectedSheet.getRange("Q:Q").insert(ExcelScript.InsertShiftDirection.right); // Set range Q2 on selectedSheet selectedSheet.getRange("Q2").setFormula("=TEXT([@[Datum Resultaat]],\"dd/mm/jjjj\")"); // Set range S2 on selectedSheet selectedSheet.getRange("S2").setFormula("=TEXT([@Startdatum],\"dd/mm/jjjj\")"); } And as second step function main(workbook: ExcelScript.Workbook) { let selectedSheet = workbook.getActiveWorksheet(); // Set format for range E:E on selectedSheet selectedSheet.getRange("E:E").setNumberFormatLocal("@"); // Set format for range Q:Q on selectedSheet selectedSheet.getRange("Q:Q").setNumberFormatLocal("@"); // Set format for range S:S on selectedSheet selectedSheet.getRange("S:S").setNumberFormatLocal("@"); } But i'm stuck at the third step. If there is an easier method that would be fine toSolved162Views0likes5CommentsExcel macro VBA issues
Hey guys. - I wrote a macro, which contain other macros using Call orders. If I running the macros separately everything ok, from the main macro one of them didn't running it's like it skipped from the list. Reason unknown. -On running I can see 4 application window get visible, and those didn't connect any kind of application. Also a Clipboard error message get visible, but I get a Clipboard cleaning macro, which several times cleaning the Clipboard, so it can't be. It's like a hack, or something which I don't recognize. - One a sheets called Total, I can't use the built in group function and can't collapse the selected section so the project I working on lost functionality. I didn't make any change on that side, but previously it was useable. Thanks for help in advance. Cheers. Zsolt91Views0likes2CommentsExcel script not updating the Refresh All button
I've used ChatGPT to create an Excel Script to effectively click on the Refresh All button to update a Query. However nothing seems to happen. Can someone confirm if this functionality not available yet? Many thanks JamesSolved216Views0likes4CommentsEXCEL FORMULA HELP
I need help. I have attached the sheet I'm working on. I need to pull the data in column B (CLIENT) from the MAIN sheet to the respective individual sheet based on column E (PREPPER). For example, if the data in B4 says 'Jason Smith' and E4 says 'Jon'; I need it to go to the JON sheet in cell B4 but not show up on sheets JANE or MARLA. Help please!! Thank you! :)Solved312Views0likes5Comments