Consulting

Results 1 to 2 of 2

Thread: search and delete

  1. #1

    search and delete

    Hi.. ok i need a code that will take the value in A1, search through C2:W2 and match it. once it is matched i need to delete everything in that colmn from 3:100

    example. A1= bob. search from C2:W2 for bob. match is found in H2, then delete H2:H100.

    any idea??

  2. #2
    VBAX Mentor MaximS's Avatar
    Joined
    Sep 2008
    Location
    Stoke-On-Trent
    Posts
    360
    Location
    try this:

    [VBA]
    Sub Delete_Rows_Meeting_Criteria()
    For x = 3 To 23
    If Cells(2, x).Value = Cells(1, 1).Value Then
    Range(Cells(3, x), Cells(100, x)).ClearContents
    End If
    Next
    End Sub
    [/VBA]

Posting Permissions

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