What Causes to Run-Time Error '1004'?
I use the same syntax in other project it has no problem but when i used it in my new project it give me Run-Time Error '1004'.
The syntax is:
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("CT_Master")
If Me.cmb_Ticket.Value = "" Or Me.cmb_Type.Value = "" Then Me.txt_Amount.Value = ""
If Me.cmb_Ticket <> "" Then
If Me.cmb_Type.Value = "Issue" Then
Me.txt_Amount.Value = Format(Application.WorksheetFunction.VLookup(Me.cmb_Ticket, sh.Range("B:D"), 3, 0), "#,##0.00")
End If
If Me.cmb_Type.Value = "Recieved" Then
Me.txt_Amount.Value = Format(Application.WorksheetFunction.VLookup(Me.cmb_Ticket, sh.Range("B:D"), 3, 0), "#,##0.00")
End If
If Me.cmb_Type.Value = "Issue" Then
Me.txt_Unit.Value = Format(Application.WorksheetFunction.VLookup(Me.cmb_Ticket, sh.Range("B:D"), 2, 0))
End If
If Me.cmb_Type.Value = "Recieved" Then
Me.txt_Unit.Value = Format(Application.WorksheetFunction.VLookup(Me.cmb_Ticket, sh.Range("B:D"), 2, 0))
End If