Using Vlookup on other Workbook whichs path is stored in a Cell

Diskutiere und helfe bei Using Vlookup on other Workbook whichs path is stored in a Cell im Bereich Microsoft Office im Windows Info bei einer Lösung; Good Day Im Trying to do Vlookup on a closed Workbook whichs path is stored in a Cell. For that im writing a Function which opens the Workbook by... Dieses Thema im Forum "Microsoft Office" wurde erstellt von Lars_2020, 26. August 2020.

  1. Lars_2020
    Lars_2020 Gast

    Using Vlookup on other Workbook whichs path is stored in a Cell


    Good Day

    Im Trying to do Vlookup on a closed Workbook whichs path is stored in a Cell.

    For that im writing a Function which opens the Workbook by the path given, and then does the VLookup on a predefined range in the newly opened Workbook. Somehow my function doesnt work and i cant find out why.

    Heres the function:

    PosType is the Value to lookup in VLookup


    Function getPosPosType As String, FilePath As String As String



    Dim FileName As String


    FileName = GetFilenameFromPathFilePath

    Workbooks.Open FilePath





    getPos = Application.VLookupPosType, WorkbooksFileName.Worksheets"Sheet0".Range"A1:B50".Value, 2, False



    End Function


    GetFilenameFromPath returns only the Filename "example.xlsx" like so:


    Function GetFilenameFromPathByVal strPath As String As String

    ' Returns the rightmost characters of a string upto but not including the rightmost '\'

    ' e.g. 'c:\winnt\win.ini' returns 'win.ini'



    If Right$strPath, 1 <> "\" And LenstrPath > 0 Then

    GetFilenameFromPath = GetFilenameFromPathLeft$strPath, LenstrPath - 1 + Right$strPath, 1

    End If

    End Function


    I have been trying to solve this for hours now but i just cant seem to find whats wrong with my code. Thanks for your help!
     
  2. Jason (Office Engine Win User

    Edit Sway on mobile device

    Editing a Sway using the website is not supported on mobile phones. If you want to edit on the phone, you need to download the Sway mobile app (of which there is currently only an iOS version). Otherwise, you'll need to continue editing on a tablet or
    desktop.

    Hope this helps!

    Jason
  3. Chcristoph_252 Win User

    excel reference style drops back to A1

    Many thanks for the suggestions. They did not help, though. I deleted the template Book.xltx in the start-up folder and made sure there is none anywhere on the C drive. After the close / open /close / open procedure I am back to A1 style.

    There is no PERSONAL.XLSB on my C drive. I checked also the spelling in lower case. But when I open an existing workbook directly in the file explorer, the I do get actually two books: the one I wanted and an empty Book1.xlsx. Is this the other workbook
    your mention? Is it associated with the root cause? I would be grateful for a sound solution.

    For the time being I implemented a Auto_Open VBA procedure, which is setting the R1C1 style at opening of the workbook. But that is a bit clumsy and I would appreciate a more professional solution.
  4. DaveM121 Win User

    Counting persons in one cell

    Hi J

    Here is the formula that would count the number of ; + 1 in a cell, which if all the persons were separated by a ; would work

    (Pleas Note, you will need to replace A1 with the appropriate cell reference)

    =LEN(A1)-LEN(SUBSTITUTE(A1,";","")) + 1

    However from your screenshot, sometimes a ; is used and other times a , is used to separate the persons names, and in that case, this is the formula you need

    =LEN(A1)-LEN(SUBSTITUTE(A1,";","")) + LEN(A1)-LEN(SUBSTITUTE(A1,",","")) + 1
  5. Andreas Killer Win User

    Ribbon Dropdown zur Laufzeit mit Daten von anderem Workbook füllen?

    Weil die Dateiendung fehlt, das Workbooks Objekt braucht den kompletten Namen.

    Der Code unten könnte hilfreich sein. Und Du solltest zuerst das Objekt auf NOTHING prüfen, sonst gibt's den nächsten Fehler in Deinem Code bei
    .Row

    Andreas.



    Function GetWorkBook(ByVal WorkBookName As String) As Workbook

    'Return the workbook that name begins with or is WorkBookName, Nothing if not open

    Dim fso As Object 'FileSystemObject

    Set fso = CreateObject("Scripting.FileSystemObject")

    'Path given?

    If Len(fso.GetParentFolderName(WorkBookName)) > 0 Then

    'Compare the full path of each open workbook

    For Each GetWorkBook In Workbooks

    If StrComp(GetWorkBook.FullName, WorkBookName, vbTextCompare) = 0 Then

    Exit Function

    End If

    Next

    ElseIf InStrRev(WorkBookName, ".") > 0 Then

    'We must exact match if an extension is given

    On Error GoTo ExitPoint

    Set GetWorkBook = Workbooks(WorkBookName)

    Else

    'Without an extension it can be a new file too

    On Error GoTo SearchIt

    Set GetWorkBook = Workbooks(WorkBookName)

    Exit Function

    SearchIt:

    On Error GoTo ExitPoint

    For Each GetWorkBook In Workbooks

    If StrComp(fso.GetBaseName(GetWorkBook.Name), WorkBookName, vbTextCompare) = 0 Then

    Exit Function

    End If

    Next

    End If

    ExitPoint:

    End Function
  6. Ge.H.a Win User

    Word 365

    In my mind not very helpful.

    Would have preferred a light-gray outline of the table (like in past versions), which does not get printed. In that way one could easily see where the table is located and where the different cells are. It is still possbile today, when activating the "Textbegrenzungen",
    but then you get also a grey line on every text line of the document, which does not at all contribute to a clear overview of the document.

    Thx anyhow for your answer.
  7. User Advert


    Hi,

    willkommen im Windows Forum!
Thema:

Using Vlookup on other Workbook whichs path is stored in a Cell - Microsoft Office

Die Seite wird geladen...

Using Vlookup on other Workbook whichs path is stored in a Cell - Similar Threads - Using Vlookup other

Forum Datum

Can we grant acces to a Mailbox which is in Softdelete?

Can we grant acces to a Mailbox which is in Softdelete?: I would like to ask a question in order to possibly work more effectively in EXO.Our current situation: We have a local AD which is synchronised with the AAD. After sync, users are assigned...
Microsoft Office 18. April 2024

2FA on mobile phone which is not Accessible anymore

2FA on mobile phone which is not Accessible anymore: Hi,I take take care of an Microsoft 365 Tenant of a Company where the Old CEO managed the IT and is no longer the CEO of the Company.Now I want to Access their Microsoft 365 Tenant as i got the...
Microsoft Office 31. Juli 2023

How to merge cells in a table on a communication site in SharePoint?

How to merge cells in a table on a communication site in SharePoint?: How do I merge cells in an existing table on a communication site in SharePoint? I can't find this option within the tools provided. Is there a work-around?Thank you so much!Best,Nina
Microsoft Office 8. Dezember 2022

Is it possible to make a script which turns apps in your autostart on or off

Is it possible to make a script which turns apps in your autostart on or off: Hello, i need to find a way to make a .bat file which turns off the autostart for an application lets say "example.exe" and activates the autostart for another "example2.exe". I searched for a...
Apps 29. September 2022

Is it possible to make a script which turns apps in your autostart on or off

Is it possible to make a script which turns apps in your autostart on or off: Hello, i need to find a way to make a .bat file which turns off the autostart for an application lets say "example.exe" and activates the autostart for another "example2.exe". I searched for a...
Games und Spiele 29. September 2022

How to condition formula on other cell content

How to condition formula on other cell content: Hi, I am not sure how else to phrase my request and hope someone can help me. I created an expense list for my project and am constantly adding new positions. The expenses are paid by several...
Microsoft Office 13. August 2020

Refer to changing workbook names (which include a date range)

Refer to changing workbook names (which include a date range): Hi, I need to copy/paste data to an OverviewWorkbook from several workbooks every month. The file name of every workbook used includes a date, eg something like...
Microsoft Office 26. April 2019
Using Vlookup on other Workbook whichs path is stored in a Cell solved
  1. Diese Seite verwendet Cookies, um Inhalte zu personalisieren, diese deiner Erfahrung anzupassen und dich nach der Registrierung angemeldet zu halten.
    Auf dieser Website werden Cookies für die Zugriffsanalyse und Anzeigenmessung verwendet.
    Wenn du dich weiterhin auf dieser Seite aufhältst, akzeptierst du unseren Einsatz von Cookies.