Use code like
Sub ActivateWB(WBName As String)
Dim WB As Workbook
For Each WB In Workbooks
If WB.Name Like WBName Then
WB.Activate
Exit Sub
End If
Next WB
End Sub
Then you can call this with code like
ActivateWB "DONE*"
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
On Wed, 8 Apr 2009 13:13:02 -0700, aileen
<(E-Mail Removed)> wrote:
>Is it possible to activate a workbook using only part of the worbook name?
>e.g. windows("Done.*").Activate. I have two workbooks open, my macro creates
>one of the wb's and the other is already open, but the end of its name will
>change everyday. For example, today the wb name is DONE3209.xlsx but
>tomorrow the wb name may be DONE3509.xlsx. The first 4 letters in the wb
>name will always be the same so I would like to use that part of the wb name
>only to activate the wb. Thanks in advance for any help.
>