Tab Wildcard

mcmba

Board Regular
Joined
Feb 17, 2002
Messages
59
I have a macro that is opening several spreadsheets, pulling data out and pasting it into a new spreadsheet. The problem is that the tab that I am pulling from has a different name and location in each spreadsheet that I am opening. My question is, I know that I can tell the macro to prompt me as what spreadsheet to open, but can I prompt the tab also??

Or, each spreadsheet that I am opening to pull data from, while all the tabs have different names, but they have the same three letters at the end of the tab name (UPL), can I wildcard it and tell the macro to look and pull from any spreadsheet containing the letters UPL ??

I'm stumped....Any advice would be appreciated! thanks!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
On 2002-02-18 04:55, mcmba wrote:
I have a macro that is opening several spreadsheets, pulling data out and pasting it into a new spreadsheet. The problem is that the tab that I am pulling from has a different name and location in each spreadsheet that I am opening. My question is, I know that I can tell the macro to prompt me as what spreadsheet to open, but can I prompt the tab also??

Or, each spreadsheet that I am opening to pull data from, while all the tabs have different names, but they have the same three letters at the end of the tab name (UPL), can I wildcard it and tell the macro to look and pull from any spreadsheet containing the letters UPL ??

I'm stumped....Any advice would be appreciated! thanks!

You could try something like:
Code:
Dim ws As Worksheet

For Each ws In ActiveWorkbook
    If Right(ws.Name,3) = "UPL" Then
    'the rest of your code
    End If
Next ws

Hope this is what you need :)

_________________

Barrie Davidson
My Excel Web Page
This message was edited by Barrie Davidson on 2002-02-18 05:07
 
Upvote 0
Pandarus gave you exactly the same reply as Barrie's (at :- htttp://www.mrexcel.com/wwwboard/messages/23147.html) when you posted this question before.
 
Upvote 0
Sorry, I did not realize that I had already posted this before! It has been a crazy week for me...I apologize for making you read this twice!!
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,177
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top