LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 280
Default Problem With Select Case

MsgBox "'" & Left(WkSht.Name, 3) & "'" includes a single quote string at
either end of the Left function, so I would have expected 'May'. The single
quotes just bracket the ends of the string, that's all. It's something I
sometimes do to verify the extents of the string.

I can't imagine why the Select Case is not working for you. What do you get
if you substitute a string for Left()?

Select Case "May"
<<Case Statements
End Select

--
Bob Kilmer

"Steve" wrote in message
hlink.net...
What do you see if you execute MsgBox "'" & Left(WkSht.Name, 3) & "'" in

the
Case Else?

"May"

Steve

"Bob Kilmer" wrote in message
...
Dunno, Steve. Worked okay for me. How does Wksht come to reference a
worksheet? (I don't see a Set statement.)

What do you see if you execute MsgBox "'" & Left(WkSht.Name, 3) & "'" in

the
Case Else?

--
Bob Kilmer

"Steve" wrote in message
thlink.net...
I have three worksheets named May-03, Jun-03 and Jul-03 in a workbook.

I
have
the following code in a macro:

Dim Wksht As Worksheet
Wksht.Activate
MsgBox Left(WkSht.Name, 3)
Select Case Left(WkSht.Name, 3)
Case "May"
RowRef = "467"
Case "Jun"
RowRef = "468"
Case "Jul"
RowRef = "469"
Case Else
MsgBox ..................
End Select

No matter which worksheet I run this on, I get the correct name of the

worksheet
in MsgBox Left(WkSht.Name, 3) but then the Select Case always go to

the
Case
Else statement. If the Macro gets it right in the Magbox function, why

doesn't
it get the Case statement?

Steve











 
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
select case in vba Hein Excel Discussion (Misc queries) 5 November 25th 09 07:28 AM
select case Hein Excel Discussion (Misc queries) 5 November 24th 09 01:19 PM
Select Case ignored Preschool Mike Excel Worksheet Functions 4 September 9th 09 08:12 PM
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
Select Case Jeff Excel Discussion (Misc queries) 1 February 27th 06 02:56 PM


All times are GMT +1. The time now is 07:03 AM.

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"