Get rid of those ActiveWorkbooks and ActiveSheets - they only apply when you specifically want to use the active book/sheet. Replace them with specific directions as to what object you are using, eg. oWB to use the workbook, osH to use that specific sheet, oWB.worksheets(1) etc.

Also, get rid of the Selections and refer directly to the range. Why select a range and then do something to the current selection if you already know what the Range is? Just do it to the Range itself!


This is the one issue with using VBA macros to record your VBA - Excel interprets your actions using the ActiveBook / Sheet and the Selection object because that is what you are using; however for generic coding purposes it will not do.


zaza