Link to home
Start Free TrialLog in
Avatar of cliffton jhed saldavia
cliffton jhed saldavia

asked on

How delete specific row/data in excel by userform.

Private Sub TextBox1_Change()
Find = Val(Me.TextBox1.Value)
c = Application.WorksheetFunction.CountIf(Sheet1.Range("B:B"), Find)
If c = 0 Then
EMPNO.Text = ""
r = Application.WorksheetFunction.Match(Find, Sheet1.Range("B:B"), 0)
Me.EMPNO.Value = Sheet1.Range("B" & r).Value
Me.QIDNO.Value = Sheet1.Range("C" & r).Value
Me.LNAME.Value = Sheet1.Range("D" & r).Value
Me.FNAME.Value = Sheet1.Range("E" & r).Value
Me.Image1.Picture = LoadPicture(Worksheets("Sheet1").Range("AZ" & r)
These are the codes that ive been using to pull up the data from sheets1 to userform1.I just wanna ask if how can I also delete the displayed data in my userform,that corresponds to data in excel sheeT?

Hope you can provide me the best answer.I really appreciate those who can.
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

It's not clear what you mean. Deleting the row from the userform is not difficult.

It's not a good idea to use the TextBox change event to make changes to the sheet

Take a look at this example
DataBaseForm.xlsm
Avatar of cliffton jhed saldavia
cliffton jhed saldavia

ASKER

what i mean is that.I want to delete the data in a sheet in excel.
Sir thank you so much for the share I'll gonna try this one.
Let me know if you need further help.
thanks you so much sir I really appreciate your help.
ASKER CERTIFIED SOLUTION
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Mr Roy Cox already provided the best solution.Thank you so much
Pleased to help
sir by the way I do have another question.This is a different question.Try to check it.
I think I've already commented there and asked for an example workbook