KillGorack
New Member
- Joined
- Jan 23, 2006
- Messages
- 35
- Office Version
- 2016
- Platform
- Windows
I'm using the following code to sort a range.
It works well when I place it in a module, but when I use this code in the worksheet.. it doesn't work at all.
Any idea?
VBA Code:
ThisWorkbook.Sheets("Area").range("A1:D18").Sort Key1:=range("B2"), Order1:=xlDescending, Header:=xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
It works well when I place it in a module, but when I use this code in the worksheet.. it doesn't work at all.
Any idea?