hi, what's the different & problem with my vba and how can i amend it?
i got overflow with this:
however, i got type mismatch when i use this
i got overflow with this:
VBA Code:
Private Sub REG18_AfterUpdate()
If WorksheetFunction.CountIf(Sheet4.Range("a:c"), Me.REG18.Value) = 0 Then
Me.REG18.Value = ""
Exit Sub
End If
With Me
.REG19 = Application.WorksheetFunction.VLookup(CLng(Me.REG18), Sheet4.Range("Lookup"), 2, 0)
.REG20 = Application.WorksheetFunction.VLookup(CLng(Me.REG18), Sheet4.Range("Lookup"), 3, 0)
End With
End Sub
however, i got type mismatch when i use this
VBA Code:
Private Sub REG18_Change()
If WorksheetFunction.CountIf(Sheet4.Range("a:c"), Me.REG18.Value) = 0 Then
Me.REG18.Value = ""
Exit Sub
End If
With Me
.REG19 = Application.WorksheetFunction.VLookup(CLng(Me.REG18), Sheet4.Range("Lookup"), 2, 0)
.REG20 = Application.WorksheetFunction.VLookup(CLng(Me.REG18), Sheet4.Range("Lookup"), 3, 0)
End With
End Sub
i need someone help, thanks for helping me out and your great help is appreciated!!