Thebatfink
Active Member
- Joined
- Apr 8, 2007
- Messages
- 410
Hi,
I'm scratching my head :/ I'm simply trying to perform a sort on some cells, but the code is in a workbook module. I have found a solution, but I don't understand why I need to do it..
Thats the code I'm using, but why do I need to activate sheet "compiled" with
before it will work?? I've specified the Workbook name AND the Worksheet name?
Thanks!
Batfink
I'm scratching my head :/ I'm simply trying to perform a sort on some cells, but the code is in a workbook module. I have found a solution, but I don't understand why I need to do it..
Code:
Workbooks(twfn).Worksheets("compiled").Range(Cells(2, pastecol), Cells(pastelastrow + 1, _
pastecol + 1)).Sort Key1:=Workbooks(twfn).Worksheets("compiled").Cells(2, pastecol)
Thats the code I'm using, but why do I need to activate sheet "compiled" with
Code:
Workbooks(twfn).Worksheets("compiled").Activate
before it will work?? I've specified the Workbook name AND the Worksheet name?
Thanks!
Batfink
Last edited: