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
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,176,410
Messages
5,902,923
Members
435,002
Latest member
chenmoti

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top