Sorting data over multiple sheets into array
Sub SortedArray()
Dim myArray(1 To 2, 1 To 362)
Dim iCt As Integer
Dim iCt2 As Integer
Worksheets.Add After:=Worksheets(Worksheets.Count)
Sheets("MAK").Range("B4:FZ4").Copy
Range("A1").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=True
Sheets("MAK").Range("B10:FZ10").Copy
Range("B1").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=True
Sheets("MKW").Range("B4:FZ4").Copy
Range("A182").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=True
Sheets("MKW").Range("B10:FZ10").Copy
Range("B182").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=True
Range("A1:B362").Sort Key1:=Range("B1"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
For iCt = 1 To 2
For iCt2 = 1 To 362
myArray(iCt, iCt2) = Cells(iCt2, iCt)
Next iCt2
Next iCt
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
End Sub
Hth,
Merjet
|