DOWNLOAD SEARCHABLE DROP DOWN WITHOUT REPETITION FILE HERE
I need help with making searchable & repetition
I need help with making searchable & repetition
How to delete a specific value in a list using VBA
view sourceprint?
'Name macro
Sub RemoveValue()
'Dimension variables and declare data types
Dim i As Single
Dim Cell As Range
'Save row number of last non-empty cell in column H to variable i
i = Worksheets("Sheet1").Range("H" & Rows.Count).End(xlUp).Row
'Assign the first non-empty cell to object Cell
Set Cell = Worksheets("Sheet1").Range("H" & i)
'Repeat everything between Do and Loop until row of object Cell is equal to 2
Do Until Cell.Row = 2
'Check if object cell is equal to value in cell E3 and is not empty
If Worksheets("Sheet1").Range("E3") = Cell And Cell <> "" Then
'Delete cell
Cell.Delete Shift:=xlUp
'Clear cell E3
Worksheets("Sheet1").Range("E3") = ""
'Stop macro
Exit Sub
End If
'Save object reference 1 row below current object to variable Cell
Set Cell = Cell.Offset(-1, 0)
Loop
'Show a message box telling the user that the value cant be found in the list
MsgBox "Can´t find value: " & Worksheets("Sheet1").Range("E3")
End Sub