Hi, I have macros which are stored in Personal.xlsb
I recently created a new one using "Record Macro".
When I run the macro it errors. The reason is that in several steps, it refers to a filename specifically (and the file being used is a different name)
How do I change the code so that it will work with any file?
Tommy
Example:
ActiveWorkbook.Worksheets("Transaction_Export_16.11.2021_0").Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets("Transaction_Export_16.11.2021_0").Sort.SortFields. _
Add2 Key:=Range("D2:D1001"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Transaction_Export_16.11.2021_0").Sort
Bookmarks