Hi,
I'm confused why the code shows error object doesn't support this property or method in this line
txt = ap.TextJoin("", False, rng)
for this part of code
Private Sub DoIt(rng As Range, r As Range)
Dim txt, x, ap As Object, c As Range
Set ap = Application
txt = ap.TextJoin("", False, rng)
With Sheets("inv").Cells(1).CurrentRegion
x = .Rows.Count
x = .Parent.Evaluate("iferror(match(""" & txt & """," & _
"a1:a" & x & "&b1:b" & x & "&c1:c" & x & ",0),0)")
If x > 0 Then
Set c = .Parent.Cells(x, 5): x = c.Value
End If
End With
MsgBox ap.TextJoin(" ", False, rng) & vbLf & IIf(x - r < 0, _
"You can't subtract", "Remains : " & x - r), , "Current stock : " & x
If x - r < 0 Then
Application.EnableEvents = False
r.ClearContents
Application.EnableEvents = True
Else
c = c - r
End If
End Sub
when I enter qty in column E for ENTER sheet will match B: D columns with A:C columns in INV sheet then will subtract QTY in column E in INV sheet from column E in ENTER sheet and show message what's the vailable qty and remaining qty for ID after subtraction.
the code was work well , why now doesn't work?!!