#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default case

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default case

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
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
change data of entire column from small case to upper case Ann Excel Worksheet Functions 1 August 16th 08 01:06 PM
How do I change from upper case to proper case in excel 2002 CT Man[_2_] Excel Discussion (Misc queries) 8 January 8th 08 06:14 PM
Changing multiple cell text from lower case to upper case Patti Excel Discussion (Misc queries) 2 January 4th 08 08:35 PM
Change the text from lower case to upper case in an Excel work boo dave01968 Excel Discussion (Misc queries) 2 December 9th 05 09:09 AM
How to use formula auditing to change upper case to Title Case. ScoobeyDoo Excel Worksheet Functions 1 November 19th 04 06:26 PM


All times are GMT +1. The time now is 02:12 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"