What is it I am missing here when running Mod.2 ?
Plesae refer to Mod. 2 in the macros, run the mod only to be shown a error message "Type mismatch". Thank you.
Code:
Sub MonthlyDispatchedUnits()
Dim Col As Long
Dim LINES As Range, Ln As Range, LnFND As Range
Dim wsMH As Worksheet
Set wsMH = Sheets("Manhood")
With Sheets("Invoice")
Set LINES = .Range("K17").SpecialCells(xlConstants)
Col = wsMH.Cells.Find(Month(.[G1]), LookIn:=xlValues, LookAt:=xlWhole).Column
For Each Ln In LINES
Set LnFND = wsMH.Cells.Find(Ln, LookIn:=xlValues, LookAt:=xlWhole)
Set LnFND = wsMH.Cells.Find("Dispatched", LnFND, LookIn:=xlValues, LookAt:=xlWhole)
If LnFND Is Nothing Then GoTo ErrorExit
wsMH.Cells(LnFND.Row, Col).Value = Ln.Offset(0, 1).Value
Set LnFND = Nothing
Next Ln
End With
Exit Sub
ErrorExit:
MsgBox "Could not find '" & Ln & "' on sheet HO Plan. Update sheet so there is a match."
End Sub