snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Sub deletePS()
lastrow = Sheets("Sheet1").Cells(Rows.Count, 2).End(xlUp).Row
For i = 2 To lastrow
If Rows(i).Find("PS") Then
Rows(i).Delete
End If
Next i
End Sub
Delete PS.xlsm
ติดปัญหาไม่สาารถรันได้ค่ะ
รบกวนขอคำชี้แนะด้วยค่ะ
You do not have the required permissions to view the files attached to this post.
Sub deletePS()
lastrow = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
For i = lastrow To 2 Step -1
If Left(Range("A" & i).Value, 2) = "PS" Then
Range("A" & i).EntireRow.Delete
End If
Next i
End Sub
Sub deletePS()
lastrow = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
For i = lastrow To 2 Step -1
If Left(Range("A" & i).Value, 2) = "PS" Then
Range("A" & i).EntireRow.Delete
End If
Next i
End Sub