Link to home
Start Free TrialLog in
Avatar of Jagwarman
Jagwarman

asked on

Remove data from a [hidden] list

I am using the below to add to a hidden list. Could a Expert provide me with VBA code that will enable data to be removed from the list.

So lets say in A30 it has Yellow and B30 Blue

If I want to remove this the a pop-up that asks for what is in column A so if I put Yellow it will remove data from A30 and B30 and then shift those cells up but not affect any other columns.

Thanks
Avatar of Jagwarman
Jagwarman

ASKER

forgot to put the code I am using:

With Sheets("Static")
    .Range("A" & .Range("A" & Rows.Count).End(xlUp).Row+1).Value = InputBox("Please enter a value for cell A" & .Range("A" & Rows.Count).End(xlUp).Row+1)
    .Range("B" & .Range("B" & Rows.Count).End(xlUp).Row+1).Value = InputBox("Please enter a value for cell B" & .Range("B" & Rows.Count).End(xlUp).Row+1)
End With
Avatar of Rgonzo1971
Hi,

pls try

With Sheets("Static")
    strFind = InputBox("Please enter a value to delete in Column A")
    Set f = .Range("A:A").Find(strFind, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)
    If Not f Is Nothing Then
        f.EntireRow.Delete
    Else
        MsgBox strFind & " not found"
    End If
End With

Open in new window

Regards
Hi Rgonzo, thanks only thing is I only want it to delete A and B as mentioned in original request.....remove data from A30 and B30 and then shift those cells up but not affect any other columns.


Thanks
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

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
excellent many thanks