A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Setting up and Configuration
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Excel Question



 
 
Thread Tools Display Modes
  #1  
Old September 6th, 2006, 04:25 PM posted to microsoft.public.excel.setup
Mindie
external usenet poster
 
Posts: 7
Default Excel Question

I have a spreadsheet that I am working on where I define some of the
information in an area on the excel sheet (For example I have 1/2, 1, 2, 2/4,
3, 4, 4/5, 5, 5/6. These fields are used for a drop down list on the same
excel sheet and allow them to pick one of these numbers within that cell. I
then take the information from that cell and input it on a cartoon to display
in an area on the cartoon based on what number that they are using for the
drop down list. For Example 2 would display in 2 and 2/4 would display in 4.
Unfortunately if I say 2 it displays in 2 if I say 2/4 it displays in 2 and
4 and I only want it to display in 4 not 2. Below is some code that I am
trying to use to allow that to happen but I think that I am missing
something. Can you help?

Dim sReturn As String

Select Case vsKettle

Case "2"
sReturn = "2"

Case "2/4"
sReturn = "4"

End Select

  #2  
Old September 7th, 2006, 09:12 PM posted to microsoft.public.excel.setup
sjk153
external usenet poster
 
Posts: 14
Default Excel Question

Try adding additional variables in your code for each number. For example:

Dim sReturn As String
Dim a As Integer
Dim b As String
Dim C As Integer

a = 2
b = "2/4"
c = 4


Select Case vsKettle

Case a
sReturn = "2"

Case b
sReturn = "2/4"

Case c
sReturn = "4"
End Select




"Mindie" wrote:

I have a spreadsheet that I am working on where I define some of the
information in an area on the excel sheet (For example I have 1/2, 1, 2, 2/4,
3, 4, 4/5, 5, 5/6. These fields are used for a drop down list on the same
excel sheet and allow them to pick one of these numbers within that cell. I
then take the information from that cell and input it on a cartoon to display
in an area on the cartoon based on what number that they are using for the
drop down list. For Example 2 would display in 2 and 2/4 would display in 4.
Unfortunately if I say 2 it displays in 2 if I say 2/4 it displays in 2 and
4 and I only want it to display in 4 not 2. Below is some code that I am
trying to use to allow that to happen but I think that I am missing
something. Can you help?

Dim sReturn As String

Select Case vsKettle

Case "2"
sReturn = "2"

Case "2/4"
sReturn = "4"

End Select

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:14 PM.


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