+ Reply to Thread
Results 1 to 2 of 2

Reference opened Listbox workbook in for loop

  1. #1
    Registered User
    Join Date
    MS-Off Ver
    Excel 2003

    Reference opened Listbox workbook in for loop

    I am trying to reference the name of a workbook selected using a listbox in a for loop. I am simply copying worksheets from the workbook in the listbox to a new worksheet where the code is located. I keep getting an error. I changed a couple of things to make it easier to see where I wanted to reference the name. OPW is the name I'm referencing.

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac

    Re: Reference opened Listbox workbook in for loop


    The syntax for getting the activeworkbook name is
    your_variable = ActiveWorkbook.Name

    Don't know whether this is actually what you want bit it seems to be what you're asking for

    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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


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