Results 1 to 2 of 2

Thread: Delete Rows based on Input Box Enrty

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Delete Rows based on Input Box Enrty

    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.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •