+ Reply to Thread
Results 1 to 2 of 2

vba searching for strings in multiple worksheets

  1. #1
    justinhale@gmail.com
    Guest

    vba searching for strings in multiple worksheets

    Hi,

    I am trying to search multiple worksheets for the word "Fail" and then
    copy all of the "fail" data that has a failure into another worksheet.
    I am able to copy one sheet to another, but cannot figure out how to
    search multiple sheets.

    The number of worksheets are dynamic. The user can add sheets to the
    workbook.

    Here is my working code for one sheet:

    With Sheet2
    For i = 1 To .UsedRange.Rows.Count

    If .Cells(i, 1) = "Fail" Then

    'Offset to select the testcase number
    Sheet1.Cells(j, 3) = Sheet2.Cells(i, 2)

    'Offset to select the Serial Number
    Sheet1.Cells(j, 2) = Sheet2.Cells(i, 4)

    j = j + 1

    Else
    Sheet1.range("B15:c500") = ""

    End If
    Next
    End With

    Thank you


  2. #2
    Valued Forum Contributor
    Join Date
    12-16-2004
    Location
    Canada, Quebec
    Posts
    363
    Hi Justin

    See attached document
    every "Fail" should be stored in worksheet "Fail_Workbook"

    Thanks
    Denis
    Attached Files Attached Files

+ 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