Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Activate an Excel spreadsheet using wildcard name

Have a visual basic macro to parse info from excel sheet
to another excel sheet with consolidated info.
Ex: Parse all of the inventory items from "location
A.xls" to "consolidated inventory.xls" sheet.
Question: how do I get the macro to parse the info from
the sheet I want, whatever that sheets name is. I.E. I
want to parse from "location A.xls" sheet, "location
B.xls" sheet etc. The macro needs to give me the option
of selecting the sheet I want to parse from, or, if I can
use wildcard (*.xls) in the macro, even better.
Thanx
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Activate an Excel spreadsheet using wildcard name

Hi Dennis,


Either select the requisite worksheet and refer to it in your code as:

Activesheet

Alternatively, put up an input box at runtime to feed the sheet name. In
your procedure add something like this:

Dim sh As Variant

Do Until sh < ""
sh = Application.InputBox( _
Prompt:="Please enter name of " _
& "Worksheet to be consolidated", _
Title:="Worksheet Name", _
Type:=2)
If sh = "False" Then Exit Sub 'User Cancelled
Loop

Then, in your code, replace the previously hard-code sheet name with the sh
object variable.


---
Regards,
Norman



"Dennis" wrote in message
...
Have a visual basic macro to parse info from excel sheet
to another excel sheet with consolidated info.
Ex: Parse all of the inventory items from "location
A.xls" to "consolidated inventory.xls" sheet.
Question: how do I get the macro to parse the info from
the sheet I want, whatever that sheets name is. I.E. I
want to parse from "location A.xls" sheet, "location
B.xls" sheet etc. The macro needs to give me the option
of selecting the sheet I want to parse from, or, if I can
use wildcard (*.xls) in the macro, even better.
Thanx



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I use a wildcard in an excel formula? Archon007 Excel Worksheet Functions 4 March 16th 07 07:16 AM
Wildcard in Excel Clark Shiao Excel Worksheet Functions 4 November 20th 06 01:27 PM
How can I get Excel to not view an * as a wildcard in a lookup? Misty Excel Discussion (Misc queries) 1 March 3rd 06 08:01 PM
De-activate the email on my spreadsheet? Rlp Excel Discussion (Misc queries) 1 March 1st 05 06:34 PM
Wildcard parameter in excel BJC Excel Discussion (Misc queries) 1 December 24th 04 12:16 PM


All times are GMT +1. The time now is 02:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"