Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Sub RemoveFromListA()
Const COL_LIST_UPDATE = 1 ' Column "A"
Const COL_LIST_MASTER = 3 ' Column "C"
Const ROW_FIRST_UPDATE = 2 ' Data starts in row 2
Const ROW_FIRST_MASTER = 2 ' Data starts in row 2
Dim MasterList As Range
Dim FoundName As Range
Dim nLastMasterRow As Long
Dim nLastUpdateRow As Long
Dim nRow As Long
Dim sName As String
nLastMasterRow = Cells(65536, COL_LIST_MASTER).End(xlUp).Row
nLastUpdateRow = Cells(65536, COL_LIST_UPDATE).End(xlUp).Row
Set MasterList = Range(Cells(ROW_FIRST_MASTER, COL_LIST_MASTER), _
Cells(nLastMasterRow, COL_LIST_MASTER))
For nRow = nLastUpdateRow To ROW_FIRST_UPDATE Step -1
sName = Cells(nRow, COL_LIST_UPDATE).Value
Set FoundName = MasterList.Find(sName)
If Not FoundName Is Nothing Then
Cells(nRow, COL_LIST_UPDATE).Delete xlShiftUp
End If
Next nRow
Set FoundName = Nothing
End Sub
Cells(nRow, COL_LIST_UPDATE).Delete xlShiftUp
Cells(nRow, 1).Delete xlShiftUp
Sub RemoveFromList(AName As String)
Const COL_NAMES = 2 ' Column "B"
Const COL_DELETE_FROM = 1 ' Column "A"
Const COL_DELETE_THRU = 2 ' Column "B"
Const ROW_FIRST_DATA = 2 ' Data starts in row 2
Dim List As Range
Dim c As Range
Dim nLastRow As Long
Dim sName As String
nLastRow = Cells(65536, COL_NAMES).End(xlUp).Row
Set List = Range(Cells(ROW_FIRST_DATA, COL_NAMES), _
Cells(nLastRow, COL_NAMES))
Set c = List.Find(AName)
If Not c Is Nothing Then
Range(Cells(c.Row, COL_DELETE_FROM), _
Cells(c.Row, COL_DELETE_THRU)).Delete xlShiftUp
End If
Set c = Nothing
Set List = Nothing
End Sub
Sub Demo()
Dim sName As String
sName = "Bourte, Martha"
RemoveFromList sName
End Sub
Sub RemoveAllNames()
Const COL_NAMES = 5 ' Column "E"
Const ROW_FIRST_DATA = 2
Dim List As Range
Dim c As Range
Dim nLastRow As Long
nLastRow = Cells(65536, COL_NAMES).End(xlUp).Row
Set List = Range(Cells(ROW_FIRST_DATA, COL_NAMES), _
Cells(nLastRow, COL_NAMES))
For Each c In List
RemoveFromList c.Text
Next c
Set List = Nothing
End Sub