Hi !!! I started a while ago with a big project and not knowing a lot about VBA, I am still learning and looking up new ways to do things. I am currently trying to sort a list based on 9 different variables (1 of the variables is on sheet "Daily Schedule" and the other 8 are on "CO Times"). I have the list of jobs on sheet "Daily Schedule" and a list of jobs on sheet "CO Times" (matrix). I want to be able to lookup the variables on sheet "CO Times" for those jobs that are on the list in sheet "Daily Schedule" and sort that list on the order specified (due date, paper width, code type, campos, max pages, inserts, envtype, envsize, and metro). This is the code I have up until now:
Sub CO_Calc()
'declare data range to sort
Dim TraRec As Range
Dim JobName As Range 'column B
Dim DueDate As Range 'column C
Dim PaperWidth As Range 'column D (4)
Dim CodeType As Range 'column E (5)
Dim CamPos As Range 'column F (6)
Dim MaxPages As Range 'column G (7)
Dim Inserts As Range 'column H (8)
Dim EnvType As Range 'column I (9)
Dim EnvSize As Range 'column J (10)
Dim Metro As Range 'column K (11)
Set DaySch = Sheets("Daily Schedule")
Set COTimes = Sheets("CO Times")
Set TraRec = COTimes.Range("A3:P200")
Set JobName =DaySch.Range("B1")
Set DueDate = DaySch.Range("C1")
Set PaperWidth = COTimes.Range("D1")
Set CodeType = COTimes.Range("E1")
Set CamPos = COTimes.Range("F1")
Set MaxPages = COTimes.Range("G1")
Set Inserts = COTimes.Range("H1")
Set EnvType =COTimes.Range("I1")
Set EnvSize = COTimes.Range("J1")
Set Metro = COTimes.Range("K1")
JobName.Sort Key1:=PaperWidth, Order1:=xlAscending, Header:=xlYes
End Sub
Sub CO_Calc()
'declare data range to sort
Dim TraRec As Range
Dim JobName As Range 'column B
Dim DueDate As Range 'column C
Dim PaperWidth As Range 'column D (4)
Dim CodeType As Range 'column E (5)
Dim CamPos As Range 'column F (6)
Dim MaxPages As Range 'column G (7)
Dim Inserts As Range 'column H (8)
Dim EnvType As Range 'column I (9)
Dim EnvSize As Range 'column J (10)
Dim Metro As Range 'column K (11)
Set DaySch = Sheets("Daily Schedule")
Set COTimes = Sheets("CO Times")
Set TraRec = COTimes.Range("A3:P200")
Set JobName =DaySch.Range("B1")
Set DueDate = DaySch.Range("C1")
Set PaperWidth = COTimes.Range("D1")
Set CodeType = COTimes.Range("E1")
Set CamPos = COTimes.Range("F1")
Set MaxPages = COTimes.Range("G1")
Set Inserts = COTimes.Range("H1")
Set EnvType =COTimes.Range("I1")
Set EnvSize = COTimes.Range("J1")
Set Metro = COTimes.Range("K1")
JobName.Sort Key1:=PaperWidth, Order1:=xlAscending, Header:=xlYes
End Sub