PC Review


Reply
 
 
=?Utf-8?B?QWxhblc=?=
Guest
Posts: n/a
 
      7th Sep 2007
Is there any wild card such as * that can be used in Case statement.

I have a VBA statement like

For Each cell In Range("C1")
Select Case cell.Value
Case "ABoy"
cell.Offset(0, 1).Value = 10
Case "A*" <----------------------------i.e. A and all other thing except A
itself
cell.Offset(0, 1).Value = 20
Case Else
cell.Offset(0, 1).Value = 99
End Select
Next

Could someone please show me the right way to do it.

Many Thanks



 
Reply With Quote
 
 
 
 
Snake Plissken
Guest
Posts: n/a
 
      7th Sep 2007
what about this:

Sub qq()


Dim MyCheck As String

MyCheck = Cells(1, 3).Value

Cells(1, 3).Select

If MyCheck = "ABoy" Then

ActiveCell.Offset(0, 1).Value = 10

ElseIf MyCheck Like "A*" Then

ActiveCell.Offset(0, 1).Value = 20

Else

ActiveCell.Offset(0, 1).Value = 99

End If

End Sub




 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Minor puzzle: some UDF calls respect mixed case, others insist onlower case Dave Peterson Microsoft Excel Programming 0 1st May 2010 12:32 AM
Re: Minor puzzle: some UDF calls respect mixed case, others insist on lower case JLGWhiz Microsoft Excel Programming 2 30th Apr 2010 09:09 PM
Comparing text fields to find upper case lower case mismatches RAN Microsoft Access Queries 3 4th Dec 2008 04:34 PM
Can't find short cut for changing case ... upper case .... lower case JERRY Microsoft Word New Users 7 23rd Aug 2007 05:29 PM
Lower case, upper case mish mash in Headings-based bookmarks =?Utf-8?B?UnV0YWJhZ2E=?= Microsoft Word Document Management 3 10th May 2007 10:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:32 AM.