+ Reply to Thread
Results 1 to 2 of 2

Update Macro to search column Bfor "Fail" and "Exception"

  1. #1
    Registered User
    Join Date
    07-08-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    11

    Update Macro to search column Bfor "Fail" and "Exception"

    Hello,

    I'm fairly new to these Excel Macros and need some help.
    I have this code that does work where it looks for the word "Fail" in Column B and grabs the text in Column C.
    How would I update the code to now include looking for "Fail" and "Exception".

    Thanks in advance for any help!

    With Worksheets("Test")

    yrow = .Range("A" & .Rows.Count).End(xlUp).Row
    .Range("A1:D" & yrow).AutoFilter field:=2, Criteria1:="Fail"
    lastRow = Worksheets("Comments").Range("B" & Rows.Count).End(xlUp).Row
    On Error Resume Next
    .Range("A3:A" & yrow).SpecialCells(xlCellTypeVisible).Copy Worksheets("Comments").Range("A" & lastRow + 1)
    .Range("C3:C" & yrow).SpecialCells(xlCellTypeVisible).Copy Worksheets("Comments").Range("B" & lastRow + 1)
    .Rows(1).AutoFilter

    End With

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Update Macro to search column Bfor "Fail" and "Exception"

    Please wrap your code with code tags as per forum's rule.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. [SOLVED] macro to search for "NO" in a cell and copy all but "NO" to a different column! plz help
    By fredderf81 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2013, 03:19 PM
  3. [SOLVED] If there is any text in column "A$" on "sheet1" then move cell to column "A$" on "sheet2"
    By ckgeary in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2013, 08:28 PM
  4. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  5. [SOLVED] Formula needed to display "Pass" or "Fail" if a column contains any values other than "yes
    By andreindy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-26-2013, 05:49 PM

Tags for this Thread

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