Sub ByContNum()
With DACNRange
W = 0
F = 1
Do Until F = .Rows.Count + 1
If InStr(1, .Cells(F, 1), Frame1.ActiveControl, 1) = 1 And .Cells(F, 4) = UserUnit Then
ListBox1.AddItem .Cells(F, 1)
ListBox1.List(W, 1) = MDF(.Cells(F, 2))
ListBox1.List(W, 2) = .Cells(F, 7)
ListBox1.List(W, 3) = .Cells(F, 5)
ListBox1.List(W, 4) = .Cells(F, 6)
ListBox1.List(W, 5) = .Cells(F, 9)
W = W + 1
End If
F = F + 1
Loop
End With
End Sub
Sub ByDate()
With DACNRange
W = 0
F = 1
Do Until F = .Rows.Count + 1
If InStr(1, .Cells(F, 2), MyDate, 1) = 1 And .Cells(F, 4) = UserUnit Then
ListBox1.AddItem .Cells(F, 1)
ListBox1.List(W, 1) = MDF(.Cells(F, 2))
ListBox1.List(W, 2) = .Cells(F, 7)
ListBox1.List(W, 3) = .Cells(F, 5)
ListBox1.List(W, 4) = .Cells(F, 6)
ListBox1.List(W, 5) = .Cells(F, 9)
W = W + 1
End If
F = F + 1
Loop
End With
End Sub
Sub ByActType()
With DACNRange
W = 0
F = 1
Do Until F = .Rows.Count + 1
If InStr(1, .Cells(F, 3), MyDate, 1) = 1 And .Cells(F, 4) = UserUnit Then
ListBox1.AddItem .Cells(F, 1)
ListBox1.List(W, 1) = MDF(.Cells(F, 2))
ListBox1.List(W, 2) = .Cells(F, 7)
ListBox1.List(W, 3) = .Cells(F, 5)
ListBox1.List(W, 4) = .Cells(F, 6)
ListBox1.List(W, 5) = .Cells(F, 9)
W = W + 1
End If
F = F + 1
Loop
End With
End Sub
Sub ByTechName()
With DACNRange
W = 0
F = 1
Do Until F = .Rows.Count + 1
If InStr(1, .Cells(F, 5), Frame1.ActiveControl, 1) = 1 And .Cells(F, 4) = UserUnit Then
ListBox1.AddItem .Cells(F, 1)
ListBox1.List(W, 1) = MDF(.Cells(F, 2))
ListBox1.List(W, 2) = .Cells(F, 7)
ListBox1.List(W, 3) = .Cells(F, 5)
ListBox1.List(W, 4) = .Cells(F, 6)
ListBox1.List(W, 5) = .Cells(F, 9)
W = W + 1
End If
F = F + 1
Loop
End With
End Sub
Sub ByArea()
With DACNRange
W = 0
F = 1
Do Until F = .Rows.Count + 1
If InStr(1, .Cells(F, 6), Frame1.ActiveControl, 1) = 1 And .Cells(F, 4) = UserUnit Then
ListBox1.AddItem .Cells(F, 1)
ListBox1.List(W, 1) = MDF(.Cells(F, 2))
ListBox1.List(W, 2) = .Cells(F, 7)
ListBox1.List(W, 3) = .Cells(F, 5)
ListBox1.List(W, 4) = .Cells(F, 6)
ListBox1.List(W, 5) = .Cells(F, 9)
W = W + 1
End If
F = F + 1
Loop
End With
End Sub
Sub BySite()
With DACNRange
W = 0
F = 1
Do Until F = .Rows.Count + 1
If InStr(1, .Cells(F, 7), Frame1.ActiveControl, 1) = 1 And .Cells(F, 4) = UserUnit Then
ListBox1.AddItem .Cells(F, 1)
ListBox1.List(W, 1) = MDF(.Cells(F, 2))
ListBox1.List(W, 2) = .Cells(F, 7)
ListBox1.List(W, 3) = .Cells(F, 5)
ListBox1.List(W, 4) = .Cells(F, 6)
ListBox1.List(W, 5) = .Cells(F, 9)
W = W + 1
End If
F = F + 1
Loop
End With
End Sub
Sub BySub()
With DACNRange
W = 0
F = 1
Do Until F = .Rows.Count + 1
If InStr(1, .Cells(F, 9), Frame1.ActiveControl, 1) = 1 And .Cells(F, 4) = UserUnit Then
ListBox1.AddItem .Cells(F, 1)
ListBox1.List(W, 1) = MDF(.Cells(F, 2))
ListBox1.List(W, 2) = .Cells(F, 7)
ListBox1.List(W, 3) = .Cells(F, 5)
ListBox1.List(W, 4) = .Cells(F, 6)
ListBox1.List(W, 5) = .Cells(F, 9)
W = W + 1
End If
F = F + 1
Loop
End With
End Sub
I hope that my question is clear for all,
Bookmarks