Solved

VBA Excel 2010 - ActiveWorkbook.Name

Posted on 2011-09-22
3
406 Views
Last Modified: 2012-05-12
Dear Experts,

Could you please advise how to write a check in VBA, which would analyse the active workbook name whether the file name contains characters "OVD"?

So for example if the file name is "OVD_0922.xlsx" in that case the answer is True, if "Book1.xls" in that case False.

thanks,
0
Comment
Question by:csehz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 34

Expert Comment

by:Norie
ID: 36579938
Something like this perhaps.

If ActiveWorkbook.Name Like "*OVD*" Then
   MsgBox "The active workbook had OVD in it's name
End If

0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 36579949
Msgbox Instr(1, activeworkbook.name, "OVD", vbtextcompare) > 0

Open in new window

for example.
0
 
LVL 1

Author Closing Comment

by:csehz
ID: 36579960
Thanks it works
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question