I want it to return the first letter of each worksheet but it returns the first letter of the initial active sheet each time, how can I get it to move to the next sheet?:
Thanks alot thast worked great, final thing, the code below only finds a Capital letter "C", how do i search without distinction between capital and non capital letters?
The problem I'm facing is that a spreadsheet arrives to my work and I have to check and change the spelling on each worksheet. So, when the spreadsheet arrives it maybe uppercase or lowercase, I need to check for the first letter irrespective of case...please help!
ok, when you use the "=" operator to compare 2 strings there is no way of saying 'ignore case'.
therefore if you want to do a check ignoring case you need to convert both strings to either upper or lower case before you do the comparison, so....
strX = H
strY = h
Both
If UCase(strX, 1)) = "H"
and
If UCase(strY, 1)) = "H"
evaluate to true.
So, all you need to do is use the UCase() method which i suggested.
This will work for however the sheet names have been formated, upper/lower or mixed case
Look again at mrmovie's post and check out the UCase and LCase Functions.
Enjoy,
Tony
-------------------------------------------------------------------------------------------- We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at [url=http://www.vbaexpress.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.