A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
You may try this one.
================
function main(workbook: ExcelScript.Workbook) {
let selectedSheet = workbook.getActiveWorksheet();
let activeCell = workbook.getActiveCell();
let activeColumn = activeCell.getAddress().split('')[0];
let table = selectedSheet.getTables()[0];
let filter = table.getAutoFilter();
filter.clearCriteria();
filter.applyFilter(activeColumn, activeCell.getValue());
}
================
This code gets the active cell and column, then gets the first table on the active sheet. It then clears any existing filters and applies a new filter to the selected column with the value of the active cell.
You may also go to Microsoft Power Automate Community - Power Platform Community to post a new thread, which is the specific channel to handle Office script issue.