The function referenced a column by name or position that does not appear in the data. This is usually caused by a missing column in a query, or a query with no results.
You can use the Arrange (By Name) function immediately after a query to force specific columns to be created, even if the query does not include them. There is also an option to Stop macro if column missing, which stops the current macro from running but continues with other macros and no error.
You can use the Filter function to stop a macro from continuing if there is no data to process. This ‘Stop macro if empty’ option stops the current macro from continuing, but does not cancel other macros and queries from running. i.e. it stops the current macro without an error.