Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
smi smi is offline
external usenet poster
 
Posts: 9
Default Case statement

I am using Excel 97 with Win 95. I have a project with a lot of If and
ElseIf statement. It work but not very clean programming.
I am looking for Case statement example on the net.
Thank you for your time.

Long


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Case statement

A Select Case statement if quite simple, and fairly well documented in the
VBA help files. A simple example of Select Case is

Dim X As Integer
X = 3
Select Case X
Case 1
MsgBox "X=1"
Case 2
MsgBox "X=2"
Case 3
MsgBox "X=3"
Case Else
MsgBox "X = something else"
End Select



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


"smi" wrote in message
...
I am using Excel 97 with Win 95. I have a project with a lot of If and
ElseIf statement. It work but not very clean programming.
I am looking for Case statement example on the net.
Thank you for your time.

Long




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Case statement

I searched google for "select case" and found over 7000 posts in the *excel*
newsgroups:

http://groups.google.com/groups?q=%2...+group:*excel*

Here are a couple by Chip Pearson:

http://www.cpearson.com/excel/DateTimeEntry.htm
and
http://www.cpearson.com/excel/DateTimeEntry.htm

smi wrote:

I am using Excel 97 with Win 95. I have a project with a lot of If and
ElseIf statement. It work but not very clean programming.
I am looking for Case statement example on the net.
Thank you for your time.

Long


--

Dave Peterson

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
Case Statement jlclyde Excel Discussion (Misc queries) 3 December 4th 08 05:04 PM
Select Case Statement Katie Excel Worksheet Functions 13 December 1st 08 07:32 PM
IF STATMENT OR CASE STATEMENT Richard Excel Discussion (Misc queries) 2 January 10th 07 10:04 AM
Anyone actually get Case statement to work ... ? ForestFeeder Excel Worksheet Functions 3 April 21st 06 04:14 PM
CASE statement equivalent Beema Excel Worksheet Functions 1 December 15th 04 09:32 AM


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