+ Reply to Thread
Results 1 to 3 of 3

How to find an item and delete row

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-06-2008
    Location
    NC
    Posts
    149

    How to find an item and delete row

    I save items with a macro to the next blank row..then use a pulldown to select an item latter....how can I use the same pulldown also and go to the list, find that item and delete the row, then I want to sort so there are no blan rows

  2. #2
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: How to find an item and delete row

    The following is what I use to delete rows, I myself am not very good at VBA and couldn't really answer your question but maybe you can tinker with this and make it work for you.

    sub deleteRows()
    
    Dim r As Integer
    
    For r = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
    If WorksheetFunction.CountIf(Range("A" & r & ":AZ" & r), "PVT*") > 0 Then
    Rows(r).delete
    End If
    Next r
    
    end sub

  3. #3
    Forum Contributor
    Join Date
    07-06-2008
    Location
    NC
    Posts
    149

    Re: How to find an item and delete row

    Hi - been playing with things....not sure if I fully understand this.

    If my row (say column B has an item in it and it says, "Item 1" in the pull down and I want the VB or macro to find the item in Column B that has "Item 1" in it and delete that row.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1