Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to make a Case Function.

Hi people of great minds.

i'm working on some codes and i need your help.

the thing is i have a table where in each row the value is sorted
according to its Item No. however, the data has to be grouped
according to its kind and printed together with a drawing that
represents such data. so i made a macro for each kind and sorted the
data first before transferring them into another sheet.

the problem is..... 1. the file size is extremely big.
2. after printing, i have to sort it out manually.

so if anybody can at least explain how to start with select case
funtion..... what variables to declare, where to take reference
from......and such..... it would be a great help.

i tried to search and found some samples, however, i can not understand
fully since most of these samples that are posted here, does not start
from the very top. mostly, they are just showing what the
errors/corrections that has to be made.

by the way, i'm new at this VB thing. and i'm very interested.

thank you very much.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default How to make a Case Function.

Hi, arcq,

Here's a nice simple case statement to start you off.
It displayd a dialog box and does different things according to the value
you enter into it.

Sub CaseStatement()
Dim WhatToDo As String

WhatToDo = InputBox("Prompt Text", "DialogBoxTitle", "Default Displayed
Value")
Select Case WhatToTo
Case 1: MsgBox ("1") 'or enter code here or the name of another
macro to run
Case 2: MsgBox ("2") 'or enter code here or the name of another
macro to run
Case 3: MsgBox ("3") 'or enter code here or the name of another
macro to run
End Select
End Sub

Select Case is based on the value of WhatToDo, which is what is returned
from the dialog box when you enter a value (in this case, 1, 2 or 3) and
click OK
I know you don't necessarily need a dialog box for your requirements, but if
you're interested in VBA, it a good prompt to be able to get info from the
user.

Hope this helps

Pete


"arcq" wrote:

Hi people of great minds.

i'm working on some codes and i need your help.

the thing is i have a table where in each row the value is sorted
according to its Item No. however, the data has to be grouped
according to its kind and printed together with a drawing that
represents such data. so i made a macro for each kind and sorted the
data first before transferring them into another sheet.

the problem is..... 1. the file size is extremely big.
2. after printing, i have to sort it out manually.

so if anybody can at least explain how to start with select case
funtion..... what variables to declare, where to take reference
from......and such..... it would be a great help.

i tried to search and found some samples, however, i can not understand
fully since most of these samples that are posted here, does not start
from the very top. mostly, they are just showing what the
errors/corrections that has to be made.

by the way, i'm new at this VB thing. and i'm very interested.

thank you very much.


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
Make cells in Excell case sensitive Mliamos Excel Discussion (Misc queries) 3 August 3rd 09 02:29 PM
countif function: how to distinguish case/make case sensitive mvwoolner Excel Worksheet Functions 3 March 18th 09 02:18 PM
Can I Make AutoFilter to be Case-Sensitive? jgraves Excel Discussion (Misc queries) 7 April 2nd 08 02:53 PM
Please help me how to make formula if as following case Rehman Excel Worksheet Functions 3 January 25th 06 06:28 PM
any way to make vlookup case sensitive? Dan in NY Excel Worksheet Functions 5 February 10th 05 09:05 PM


All times are GMT +1. The time now is 09:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"