Tech Support Forum banner
1 - 2 of 2 Posts

·
Registered
Joined
·
1,437 Posts
Discussion Starter · #1 ·
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)

Example:
ActiveWorkbook.Worksheets("Transaction_Export_13.11.2021_0").Sort.SortFields. _
Clear

How do I change the code so that it will work with any file?

Tommy
 
1 - 2 of 2 Posts
Top