Andresndor
07-24-2018, 01:44 PM
Hello All. I'm new to this forum and have a limited knowledge of writing VBA but I'm looking to change that.
In the attached sheet I would like to delete any rows where the results from the input box are not equal to the value in column "O".
I tried to use the following code but I'm getting the Error: Invalid or Unqualified Reference.
Sub BatchID()
'Declare Variable
Dim BatchID As String
'Get String from Input Box
InputBox ("Enter the batch id you need ")
'Delete any row where BatchId is <> value in Column ("O1 to end)
If BatchID <> Range("O:O") Then .Delete.EntireRow
End Sub
Any help on this would be greatly appreciated.
Thanks.
In the attached sheet I would like to delete any rows where the results from the input box are not equal to the value in column "O".
I tried to use the following code but I'm getting the Error: Invalid or Unqualified Reference.
Sub BatchID()
'Declare Variable
Dim BatchID As String
'Get String from Input Box
InputBox ("Enter the batch id you need ")
'Delete any row where BatchId is <> value in Column ("O1 to end)
If BatchID <> Range("O:O") Then .Delete.EntireRow
End Sub
Any help on this would be greatly appreciated.
Thanks.