Results 1 to 4 of 4

VBA code to retrieve worksheet names from an external workbook and update the current actv

Threaded View

  1. #1
    Registered User
    Join Date
    02-01-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    16

    VBA code to retrieve worksheet names from an external workbook and update the current actv

    I have an Excel workbook (BAMinit) code as attached
    It's purpose is to retrieve all of the worksheet names from another workbook (Bet Angel Multiple)
    then populate column A in BAMinit with these sheet names then go and initialise each of the retrieved sheets in Bet Angel Multiple
    Used to WORK LIKE A CHARM but has suddenly thrown an error when it gets to the THIRD sheet name when using Sheet.Name in the loop of all sheet names in Bet Angel Multiple

    Section of code (part of fully attached ) is:

    'Capture Sheet names and define formula to see if it should be initialised
    For xLoop = 1 To xCount
    xSheet = Sheets(xLoop).Name
    ThisWorkbook.Activate
    Range("A" & xLoop + 4) = xSheet
    xWbk.Activate
    Next xLoop

    Have explored all options but with no result

    Any help much appreciated

    Thanks

    BazzaBit
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Code that finds and deletes names from current sheet to all worksheets in workbook
    By grazian2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-01-2013, 11:51 AM
  2. Replies: 2
    Last Post: 07-31-2013, 03:21 PM
  3. [SOLVED] Copying data from external workbook into current workbook based on cell value
    By Brontosaurus in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-07-2012, 11:17 AM
  4. How do I retrieve the current workbook link in vba?
    By whylite in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-17-2006, 01:15 AM
  5. Replies: 3
    Last Post: 06-10-2005, 04:05 PM

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