Summary: I have a tab called "Working List", in column AI is a Yes/No/Blank field. Once a day (may use a button, may create a power automate flow, not sure yet), we want to run a script that moves the "Yes" rows to another sheet called "Completed" (paste as values).
I am super new to script and not great at VBA (working on it), so I have read as much as I could but am not quite understanding how to make this work. I originally had a macro setup but quickly learned that online workbooks don't like that...
The struggle mainly has been that the "working list" tab (Working List Tab); columns B - AH is a pivot table (power query connection to a Power BI data set). Column A & AI - AN are tables just because I wanted to see if that made a difference (Columns A = table name "Claimed"; AI - AN = table name "Completed_WL"). The "Completed" tab is fully a table (table name - table2), in case that makes a difference.
I need the full row A - AN to be pasted as values. I don't need it to delete the rows - once the data set updates it will filter out.
I have tried using the "record" option, but it only copies and pastes the first row. I am not sure what to add/change to copy visible only:
function main(workbook: ExcelScript.Workbook) {
let completed_WL = workbook.getTable("Completed_WL");
completed_WL.getColumnByName("Completed").getFilter().applyValuesFilter(["Yes"]);
let table2 = workbook.getTable("Table2");
let selectedSheet = workbook.getActiveWorksheet();
table2.getColumn("Claimed").getRangeBetweenHeaderAndTotal().getRow(0).copyFrom(selectedSheet.getRange("A5:AN5"), ExcelScript.RangeCopyType.values, false, false);
completed_WL.getColumnByName("Completed").getFilter().clear();
}
Any help would be greatly appreciated!!