Hi everyone, I'm trying to build to 2 mulitimensional arrays to compare against each other.
When it finds matchs it will output the contents of the array.
The fields I want to put in the first array are "Shedule_P" and "Shedule_D" they both have the same number of rows.
The second array should hold "Sheet_P" and "Sheet_D". They also have the same number of rows for those 2 variables.
The loop would be the first instance of "Shedule_P" and "Shedule_D" would go against "Sheet_P" and "Sheet_D"
Then "Sheet_P" and "Sheet_D" would incriment and check again.
Once the "sheet" Array hits the end the the "Schedule variable would incriment and the process would repeat.
Any help would be greatly appreciated.
Thanks
When it finds matchs it will output the contents of the array.
The fields I want to put in the first array are "Shedule_P" and "Shedule_D" they both have the same number of rows.
The second array should hold "Sheet_P" and "Sheet_D". They also have the same number of rows for those 2 variables.
The loop would be the first instance of "Shedule_P" and "Shedule_D" would go against "Sheet_P" and "Sheet_D"
Then "Sheet_P" and "Sheet_D" would incriment and check again.
Once the "sheet" Array hits the end the the "Schedule variable would incriment and the process would repeat.
Any help would be greatly appreciated.
Thanks
Code:
Sub CopyJobs()
'
'This will copy the Job Name to the correct cell
'
Dim f_slash As Long
Dim Sec_slash As Long
Dim colin As Long
Dim StartDate As Long
Dim EndDate As Long
Dim Shedule_D As Date
Dim Shedule_P As String
Dim Sheet1Date As Date
Dim Sheet1Press As String
'===================================================================
Range("J1").Select ' Gets the Date from Report
' Get start position of the date
colin = InStr(1, ActiveCell, ",") 'first ":" in the cell
f_slash = InStr(1, ActiveCell, "/") 'first "/" in the cell
StartDate = f_slash - (f_slash - colin - 1) 'get the start position subtract the two
' Get the length
Sec_slash = InStr(f_slash + 1, ActiveCell, "/") + 4 'second "/" in the cell
EndDate = Sec_slash - StartDate + 1 'get the length start pos minus the end
' Mid command to isolate the date
Shedule_D = Mid(ActiveCell, StartDate, EndDate)
'===================================================================
' Gets the Press from Schedule Report
Shedule_P = Mid(Range("A1").Select, 1, 7)
'===================================================================
' Get the Date and Press from Sheet1
Sheet1_D = Sheets("Sheet1").Range("B1") ' Gets Date from sheets 1 (starts Here)
Sheet1_P = Sheets("Sheet1").Range("A3") ' Gets Press from sheets 1 (starts Here)
'===================================================================
'*** Everything works to this point***
'===================================================================
'Building arrays from Report Page
Dim RowInfo() As Variant
Dim cnt01 As Long
Dim cnt02 As Long
Dim r As Range
Dim n As Long
Range("A1").Select
Selection.End(xlDown).Select
Set r = Range("A1:" & Selection.Address) 'This is where you set the column to sort on
For n = 1 To r.Rows.Count
For n = 1 To r.Rows.Count
ReDim Preserve RowInfo(cnt01,cnt02) 'Make RowInfo dynamic.
RowInfo(cnt01, cnt02) = (Shedule_P ^ Shedule_D)
Next n
Next n
For n = 1 To r.Rows.Count
For n = 1 To r.Rows.Count
Debug.Print RowInfo(cnt01, cnt02)
Next n
Next n
End Sub