Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Wildcards in workbook name

Hi all,

Just a small matter in that I want to select a workbook in order for a macro
in another workbook to collect the necessary variables. The name of the file
will change month on month but will always start with "COM". I guessing that
wildcards will be needed in a code to select a workbook with "COM" in it's
title but can anyone provide tha code? I need this to try and limit as much
as possible user input to run the macro

Many thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Wildcards in workbook name

A different approach. When you open the file set that workbook to a workbook
object, and then use that later in the code.

Set myWb = Workbooks.Open("C:\MyTest.xls")

'....

myVar1 = myWB.Worksheets(1).Range("A1")
'etc.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"DCHK" wrote in message
...
Hi all,

Just a small matter in that I want to select a workbook in order for a

macro
in another workbook to collect the necessary variables. The name of the

file
will change month on month but will always start with "COM". I guessing

that
wildcards will be needed in a code to select a workbook with "COM" in

it's
title but can anyone provide tha code? I need this to try and limit as

much
as possible user input to run the macro

Many thanks



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
Wildcards and if Arlene Excel Worksheet Functions 3 June 21st 07 12:05 AM
Wildcards in VBA oodam Excel Programming 6 June 19th 06 07:03 PM
Wildcards in RTD JKC Excel Discussion (Misc queries) 0 February 3rd 06 07:35 PM
wildcards in vba shellshock Excel Discussion (Misc queries) 3 July 21st 05 07:37 PM
Wildcards in other workbook cell refrence? Pootler Excel Worksheet Functions 1 June 2nd 05 05:55 PM


All times are GMT +1. The time now is 06:22 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"