I'm having some real trouble with the 'Range' object, and it's not the first time - basically , the debugger flags the request to select a cell or range of cells as failed, and I *cannot* see why. Code is as follows:
For x = 0 To UBound(sheetarray)
WeeklyReturnBook.Sheets("Sheet" & Trim(Str(x + 1))).Activate
Range("A1"
.Select
Selection.Sort Key1:=Range("E2"
, Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
WeeklyReturnBook.Sheets("Sheet" & Trim(Str(x + 1))).Name = sheetarray(x)
Next x
What happens is their is a workbook with 9 sheets (normally), each sheet is selected, and then I want to select a 'range' of cells (with the sort I believe it'll auto select all the data - so you need only select the top left hand cell - well, it's a direct copy from the macro
) - then sort them based on column E. Problem is, it's not working , and it's always the 'Range' object that causes trouble, as I understand it, it's syntatically correct - but, well, probablly something I'm missing ![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Cheers guys
Joseph.
For x = 0 To UBound(sheetarray)
WeeklyReturnBook.Sheets("Sheet" & Trim(Str(x + 1))).Activate
Range("A1"
Selection.Sort Key1:=Range("E2"
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
WeeklyReturnBook.Sheets("Sheet" & Trim(Str(x + 1))).Name = sheetarray(x)
Next x
What happens is their is a workbook with 9 sheets (normally), each sheet is selected, and then I want to select a 'range' of cells (with the sort I believe it'll auto select all the data - so you need only select the top left hand cell - well, it's a direct copy from the macro
Cheers guys
Joseph.