Run VBA Error 91
Posted: Tue Oct 08, 2013 1:51 pm
รบกวนอาจารย์ช่วยด้วยครับ
ผมคลิกที่ ลบข้อมูล แล้วเกิด ERROR 91
ทำอย่างไรไม่ให้ขึ้น ERROR
ผมคลิกที่ ลบข้อมูล แล้วเกิด ERROR 91
ทำอย่างไรไม่ให้ขึ้น ERROR
ชุมชนความรู้ Excel และ Microsoft 365 สำหรับการทำงานจริง ตั้งแต่สูตร ฟังก์ชัน VBA, Power Query, PivotTable, Dashboard และ AI จนถึงการวิเคราะห์ข้อมูลและพัฒนาระบบงานในองค์กร
https://snasui.com/
Code: Select all
Option Explicit
Private Sub Del_Click()
Dim i As Integer
If Range("H8") = "" Then Exit Sub
If Worksheets("Aging").Columns("C:C").Find(Range("H8"), LookIn:=xlValues) Is Nothing Then MsgBox "äÁèÁÕàÅ¢·Õè¹Õé"
i = Worksheets("Aging").Columns("C:C").Find(Range("H8"), LookIn:=xlValues).Row
Worksheets("Aging").Rows(i).Delete
MsgBox "źàÅ¢·Õè" & Range("H8") & "àÃÕºÃéÍÂáÅéÇ"
End SubCode: Select all
'Other code
If Worksheets("Aging").Columns("C:C").Find(Range("H8"), LookIn:=xlValues) Is Nothing Then
MsgBox "ไม่มีเลขที่นี้"
Exit Sub
End If
'Other code