Results 1 to 4 of 4

use "search" in a closed workbook

Threaded View

amy_cmte use "search" in a closed... 05-15-2009, 01:29 PM
shg Re: use "search" in a closed... 05-15-2009, 01:30 PM
Keyur Re: use "search" in a closed... 05-17-2009, 08:53 AM
amy_cmte Re: use "search" in a closed... 05-19-2009, 11:21 AM
  1. #1
    Registered User
    Join Date
    05-14-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    2

    use "search" in a closed workbook

    Hi,

    I created a code to return value of a destinated cell from a list of closed workbooks in a folder. Now my question is how do I alternate the code to "search" through to return a destinated value? The difference is that for the current solution, I must know my destinated cell ahead of time, when in reality, I don't know where it is due to differences in different excel sheets.

    Thank you for your help. - Amy

    
    Private Function GetInfoFromClosedFile(ByVal wbPath As String, _
        wbName As String, wsName As String, cellRef As String) As Variant
    Dim arg As String
        GetInfoFromClosedFile = ""
        If Right(wbPath, 1) <> "\" Then wbPath = wbPath & "\"
        If Dir(wbPath & "\" & wbName) = "" Then Exit Function
        arg = "'" & wbPath & "[" & wbName & "]" & _
            wsName & "'!" & Range(cellRef).Address(True, True, xlR1C1)
        On Error Resume Next
        GetInfoFromClosedFile = ExecuteExcel4Macro(arg)
    End Function
    Last edited by amy_cmte; 05-15-2009 at 01:35 PM. Reason: wrong location

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