Delete record in worksheets

Rizana

Board Regular
Joined
Jul 7, 2006
Messages
105
I'm working on a simple program that lets the user enter, edit and
print the data. I developed the program using Microsoft Excel 2003 with
VBE.

Under the Edit button I want to enable the user to
edit the existing data and save as well as to save as another name.

To delete the data in the worksheets, I used this code:

Code:
Private Sub CommandButton2_Click()
Dim MyDel As String


MyDel = InputBox("Delete?")

For i = Range("a1:a10000").Count To 1 Step -1
If Cells(i + 1, "a") = MyDel Then
Cells(i + 1, "a").EntireRow.delete
End If
Next i

End Sub

But, the problem is that how can I delete the data that correspond to another 2 values?

Example:
To delete a data, the user need to first enter the SpecNo and IssueNo. Only then, the user can enter the component to be deleted.

The system need to first recognize the SpecNo and IssueNo, as to find the component.


Any ideas?
Thanks in advanced
 

Some videos you may like

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Watch MrExcel Video

Forum statistics

Threads
1,111,491
Messages
5,541,034
Members
410,542
Latest member
GDiddy1984
Top