+ Reply to Thread
Results 1 to 2 of 2

Assigning Variable Based on Partial Name of an Open File

  1. #1
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Midwest
    MS-Off Ver
    Excel 365
    Posts
    124

    Assigning Variable Based on Partial Name of an Open File

    I have an excel template that feeds data into a one of two master data excel files (165Master or 171Master) as the template is filled out.
    Part of the code that is in the template that feeds the data into one of those Master files is:
    Please Login or Register  to view this content.
    The template is opened through the Master file, so either 165Master or 171Master will be open when data is entered into the template.
    My problem is how can I assign wb so it detects the correct Master to place the data into?
    Since one of the Master files is already open during this process, I thought there might be code that could detect an opened file with the name "Master" in it and assign that to wb since that would cover both 165Master and 171Master.
    Or perhaps an if statement such as:
    Please Login or Register  to view this content.
    But I fall short of using correct syntax.
    Any input is much appreciated.
    Thank you.

    Luke

  2. #2
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Midwest
    MS-Off Ver
    Excel 365
    Posts
    124

    Re: Assigning Variable Based on Partial Name of an Open File

    I put a little sweat in and found my solution. This is one of the few times that research has actually solved my specific vba problem. Heres what I got:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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