Results 1 to 5 of 5

Thread: Vba - Check String/Text From Multiple Workbook Without Opening All Files

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Member p45cal's Avatar
    Join Date
    Oct 2013
    Posts
    94
    Rep Power
    12
    Late in the day, I know. This one looks for strings only (numbers are ignored) in that range:
    Code:
    Sub blah()
    Set fs = CreateObject("Scripting.FileSystemObject")
    Pth = "D:\Target"
    Set f = fs.GetFolder(Pth)
    For Each wb In f.Files
      If InStr(1, wb.Type, "Excel", vbTextCompare) > 0 Then
        With Range("C4") 'use a cell where it doesn't matter
          .Formula2R1C1 = "=SUMPRODUCT(--ISTEXT('" & Pth & "\[" & wb.Name & "]Sheet1'!R6C1:R11C15))"
          If .Value > 0 Then If Len(msg) = 0 Then msg = wb.Name Else msg = msg & vbLf & wb.Name
          .Clear
        End With
      End If
    Next wb
    If Len(msg) > 0 Then
      MsgBox "Workbooks containing any string in range B6:O11 are:" & vbLf & msg
    Else
      MsgBox "None found"
    End If
    End Sub

    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 07-07-2023 at 01:08 PM.

Similar Threads

  1. Replies: 116
    Last Post: 02-23-2025, 12:13 AM
  2. Replies: 101
    Last Post: 06-11-2020, 02:01 PM
  3. Replies: 2
    Last Post: 04-14-2013, 09:15 PM
  4. Replies: 2
    Last Post: 01-29-2013, 02:45 PM
  5. Replies: 2
    Last Post: 09-24-2012, 09:20 PM

Posting Permissions

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