Yes you can do it.
As long as this linedoes not have a workbook name before it ..for e.g![]()
With Worksheets(1)
, then you can use it with any workbook. It will always run on the data in the 1st sheet. You can change that to whatever you want to customize it like![]()
With Workbooks("xxx.xls").Worksheets(1)
You can also have this macro in an independent macro file which you can use to save all your macros.![]()
With Worksheets("Sheet1")
Bookmarks