mau tanya kenapa selalu muncul runtime error "91" : Object variable or with block variable not set
ini sample codenya :
If iFind Is Nothing Then Set iFind = WipCodeInvES01.Find(what:=WIPCode, _ After:=WipCodeInvES01("6"), _ LookIn:=xlValues, _ Lookat:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If iFind Is Nothing Then With wsWIPConsumption .Cells(r, 7).Value = "0" .Cells(r, 8).Value = "0" End With End If Set sel = iFind else Set sel = WIPCodeInv.Find(what:=WIPCode, _ After:=sel, _ LookIn:=xlValues, _ Lookat:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If sel Is Nothing Then With wsWIPConsumption .Cells(r, 7).Value = "0" .Cells(r, 8).Value = "0" End With End If End If If sel.Address = iFind.Address Then Exit Do End If Select Case iSht.Name Case Is = "A" JumQty = JumQty + iSht.Cells(sel.Row, 21).Value JumAmount = JumAmount + iSht.Cells(sel.Row, 22).Value Case Is = "B" JumQty = JumQty + iSht.Cells(sel.Row, 31).Value JumAmount = JumAmount + iSht.Cells(sel.Row, 32).Value Case Is = "C" JumQty = JumQty + iSht.Cells(sel.Row, 29).Value JumAmount = JumAmount + iSht.Cells(sel.Row, 30).Value
A B C
243110001 A 3
243110002 A 5
243110003 B 5
243110004 B 7
243130005 B Error
243140006 C
243150007 C
211110008 C
jadi saya ingin mengambil nilai C pada 1 file yg mempunyai banyak sheet saya misalkan Sheet A sampai Sheet C
pada saat di tengah proses untuk mengambil nilai di sheet B ada muncul error runtime "91" dan code berhenti di jumQty.
apa ada yang bisa bantu