+ Reply to Thread
Results 1 to 6 of 6

macro will not look at active workbook

  1. #1
    Registered User
    Join Date
    05-09-2008
    Posts
    8

    macro will not look at active workbook

    For some reason my macro has stop working, I have 2 workbooks open in the same excel session. each with its own unique name. The macro looks for a specific name and then copies data from this workbook to the 2nd workbook. For some reason it no longer like the name of the workbook #1 which has not change (as far as I can tell) When I run the macro i get the run time error '9' subscript out of range, when i click on the debug this is what is highlighted and underlined.


    Please Login or Register  to view this content.
    the cell BP01 has the exact name of the 2nd workbook with no spaces or extra dashes that I can tell. i have removed and retyped in the name to assure all letters and space are correct in this cell.

    I am using this formula in cell BP01

    =CONCATENATE(BJ1," ",BL2,"-",BM2,"-",BO2,".xls")

    BJ1 = name of 2nd workbook
    BL2 = Month
    BM2 = day
    BO2 = year


    Any suggestions or how to fix this error?

    thanks
    Last edited by long7time; 04-22-2009 at 11:07 AM. Reason: put code tags in

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: macro to look at active workbook

    Please edit your post to add code tags.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    05-09-2008
    Posts
    8

    Re: macro will not look at active workbook

    This is done now, sorry

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: macro will not look at active workbook

    Thanks.

    Try
    Please Login or Register  to view this content.
    Pathname should specifically NOT include a path - just the workbook name.

    And if you want to reference the active workbook, there's no need -- it is, by definition, the activated workbook.

  5. #5
    Registered User
    Join Date
    05-09-2008
    Posts
    8

    Re: macro will not look at active workbook

    thank you for the input, that was the solution to the problem.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: macro will not look at active workbook

    You’re welcome. Would you please mark the thread as Solved?

    Click the Edit button on your first post in the thread

    Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes

+ Reply to Thread

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