Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Option Compare Text

Graham,

If you put 'Option Compare Text' at the very top of the code
module (not the procedure), all text comparisons in that module
will be case-insensitive. Short of that, you can use StrComp to
compare two strings and see if they are equal. E.g.,

If StrComp(ActiveWorkbook.Name, "template", vbTextCompare) = 0
Then
' strings are equal
Else
' strings are not equal
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Graham" wrote in message
...
Hi,

I am trying to perform a certain operation via AutoOpen
that will only run if the workbook name is "template" for
example. If the workbook name is anything else I would
like AutoOpen to ignore the procedure. I have been advised
to use Option Compare Text, but I don't know how! Help
please!

Thanks
Graham



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
Compare text in cell to custom text format?? Tommy[_4_] Excel Discussion (Misc queries) 1 July 20th 07 02:45 PM
Add a text to rows option Lisa Excel Worksheet Functions 3 August 24th 06 11:18 PM
compare side by side tool option DHIJAY Excel Discussion (Misc queries) 1 June 19th 06 07:13 AM
In Excel, option to enter text in cells the same as text boxes RobGMU Excel Worksheet Functions 0 October 26th 05 04:20 PM
in excel the option to "compare side by side with" is missing. lost lucy New Users to Excel 2 October 7th 05 01:25 AM


All times are GMT +1. The time now is 11:07 PM.

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

About Us

"It's about Microsoft Excel"