+ Reply to Thread
Results 1 to 2 of 2

Thread: delete row if value in column matches cell

  1. #1
    Registered User
    Join Date
    06-07-2011
    Location
    Göteborg, Sweden
    MS-Off Ver
    Excel 2003
    Posts
    14

    delete row if value in column matches cell

    I need help writing a macro that search through column B for a valute that is located under another workbook, namely here:
    Workbooks("Copy of Kopia med makro").Sheets("Projkektuppföljning").Range("B46").

    If anything matches this cell value, I want to delete the entire row.

    Thanks in advance !

  2. #2
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    116

    Re: delete row if value in column matches cell

    Try this code...

       For i = Cells(Rows.Count, "B").End(xlUp).Row To 1 Step -1
          If Cells(i, "B").Value = Sheets("Projkektuppföljning").Range("B46").Value Then
             Cells(i, "B").EntireRow.Delete
          End If
       Next i

+ 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.2.0