• INDIRECT.EXT function, PULL function

    From grant.strongarm@gmail.com@21:1/5 to paul on Tue Dec 17 22:02:56 2019
    On Friday, May 28, 2004 at 1:32:35 PM UTC+10, paul wrote:
    INDIRECT.EXT successfully returns the VALUE (CONTENTS) in
    the target cell from an open or closed workbook and works
    for SUM() etc., but not an address range for use in say
    VLOOKUP() or MATCH() search ranges.
    PULL returns a range address but does not work when the
    target workbook is OPEN.
    I need a solution to obtain a range address from a
    workbook (both open or closed) to use in the MATCH or
    VLOOKUP functions.
    Can anyone help,
    Thanks in anticipation

    Paul

    Hi,

    Appreciate this is a dormant thread - but just in case someone is monitoring.

    I have tried to implement the pull function as per Harlan's most recent update, but notice that while it works for named ranges consisting of a single cell, it fails for multi-cell ranges.

    It looks as if r below is returned as NOTHING regardless of whether the range is single or multi-celled. So the first limb of the if statement is executed regardless.

    In the case where the range is a single-cell, the ExecuteExcel4Macro returns the value. But in the case of a multi-cell range, it simply falls over. My guess is that it should get to the second limb of the if statement in this case.

    Set r = xlwb.Sheets(1).Range(Mid(xref, n + 1))

    If r Is Nothing Then
    pull = xlapp.ExecuteExcel4Macro(xref)

    Else
    For Each C In r
    C.Value = xlapp.ExecuteExcel4Macro(b & C.Address(1, 1, xlR1C1))
    Next C

    pull = r.Value

    End If

    Any thoughts or suggestions greatl appreciated.

    Thanks & regards,

    Grant

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)