Delete rows with names

T

TGalin

Sub Deletenames()

Dim Going As Long
Dim Far As Long
Dim Pass As Range
Going = ActiveSheet.Cells(10000, 2).End(xlUp).Row
For Far = Going To 1 Step -1
Set Pass = ActiveSheet.Range("N" & Far)
If Pass.Value = "Every name but name entered in textbox" Then
Pass.Offset(-1).Resize(2).EntireRow.Delete
End If
Next Far

End Sub

I am looking for assistance with this code. I’d like to add additional
steps to the start of it. Ideally I would like to run this macro and have a
textbox appear with a message that reads “What’s your name?†Below this
question is an empty field with a combo box linked to various different names
on “Sheetlookhere†N2:N1000. Whatever name is selected into the combo box
will be searched on SheetEmployee1, SheetEmployee2, and SheetEmployee3. Each
row in Column N that does not contain the name that was selected will be
deleted + the row above it will also be deleted. Can you advise?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top