+ Reply to Thread
Results 1 to 3 of 3

Wildcard on tab name to copy data

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Wildcard on tab name to copy data

    Hello,

    I have a looper file with code that says find this tab go to it copy the data and bring it back to the looper macro. It does this over and over stacking the data together for analysis. There is 120 files for me to loop through. The problem is the users of the file in half the cases changed the tab name. Is there a way to modify this code so that it uses a wildcard to find the tab and pull the data? See the code below.

    Some tab names are "Periodic_PA_PY_Commentary" others are "Periodic_PA_PY_Commenta_1" I tried using the wildcard in the code below but it debugs on the line with the wildcard in it.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Wildcard on tab name to copy data

    I think i figured it out. Use the codename instead.

    wkbTarget.Sheets(2).UsedRange.Copy

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Wildcard on tab name to copy data

    Like so:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy out sub-string from other content in cell with wildcard?
    By POHRT in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-21-2016, 04:03 AM
  2. VBA code needed to copy rows based on mulitple wildcard criteria
    By derryt in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-11-2014, 08:56 AM
  3. [SOLVED] Wildcard search, copy and paste in excel 2010
    By IcedMilkTea in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2013, 09:24 PM
  4. Batch to Copy with wildcard in file name
    By ashokunbi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2013, 09:57 AM
  5. activate and copy open workbook using a wildcard
    By sammar12 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-25-2012, 12:32 PM
  6. Copy files via wildcard, FileCopy not working
    By koltregaskes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-22-2011, 10:33 AM
  7. Copy Data between two workbooks (Wildcard windows().Activate)
    By gfishman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2010, 02:20 PM

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