I have a data sheet that contains data for an apartment complex. I made userforms to add tenants, edit and delete them. however the way I am deleting them it leaves a gap in my data and it becomes very annoying to have to go in and delete all the rows by hand to keep the sheet looking clean.
Sheet1.Select
Dim FndRng As Range
Set FndRng = Sheet1.Columns("C:C").Find(What:=cboName.Value, LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
If Not FndRng Is Nothing Then 'successful find
FndRng.Offset(0, -1).Value = ""
FndRng.Value = ""
FndRng.Offset(0, 1).Value = ""
FndRng.Offset(0, 2).Value = ""
FndRng.Offset(0, 3).Value = ""
FndRng.Offset(0, 4).Value = ""
FndRng.Offset(0, 5).Value = ""
FndRng.Offset(0, 6).Value = ""
FndRng.Offset(0, 7).Value = ""
FndRng.Offset(0, 8).Value = ""
FndRng.Offset(0, 9).Value = ""
FndRng.Offset(0, 10).Value = ""
FndRng.Offset(0, 11).Value = ""
cboName.Value = ""
txtCode.Value = ""
cboGrade.Value = ""
txtPhone.Value = ""
txtDormitory.Value = ""
cboPhase.Value = ""
cboCourse.Value = ""
cboStatus.Value = ""
txtGrad.Value = ""
txtCsd.Value = ""
txtSsn.Value = ""
txtComments.Value = ""
cboSex.Value = ""
Else ' unable to find the value in "Name"
MsgBox "Name not found in Datasheet, Do not change the name while editing the profile.", , "Name not Found"
End If
End Sub
But as you can see that just leaves a big gap in the data. I want to do something like
fndRng.row.delete
or something that meant that, if you can follow my thought process?
Thank you in advance for any help!!