Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default function for looking up text

hi, don't know what's wrong with this function. it shall take the value of a
cell and via select case look, whats in it and write into the active cell a
certain text.

Function PreTimeSlotsConv18(PreSlot18)
Select Case PreSlot18
Case "Slot 1"
PreTimeSlotsConv18 = "17:35"
Case "Slot 2"
PreTimeSlotsConv18 = "17:20"
Case "Slot3"
PreTimeSlotsConv18 = "17:05"
End Select
End Function

cheers
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default function for looking up text

Works fine here. I presume you are using it in a worksheet? What do you get?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Kathl" wrote in message
...
hi, don't know what's wrong with this function. it shall take the value of
a
cell and via select case look, whats in it and write into the active cell
a
certain text.

Function PreTimeSlotsConv18(PreSlot18)
Select Case PreSlot18
Case "Slot 1"
PreTimeSlotsConv18 = "17:35"
Case "Slot 2"
PreTimeSlotsConv18 = "17:20"
Case "Slot3"
PreTimeSlotsConv18 = "17:05"
End Select
End Function

cheers



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default function for looking up text

Hi,

Apart from a small (I assume) typo Slot3 Slot 3 I can see nothing wrong with
it. If you call it with:-

=PreTimeSlotsConv18(A1)

If A1 contains Slot 1 it returns the text string 17:35. Is that what you
want it to do?

Mike


"Kathl" wrote:

hi, don't know what's wrong with this function. it shall take the value of a
cell and via select case look, whats in it and write into the active cell a
certain text.

Function PreTimeSlotsConv18(PreSlot18)
Select Case PreSlot18
Case "Slot 1"
PreTimeSlotsConv18 = "17:35"
Case "Slot 2"
PreTimeSlotsConv18 = "17:20"
Case "Slot3"
PreTimeSlotsConv18 = "17:05"
End Select
End Function

cheers

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default function for looking up text

now i'm really getting lunatic...

before i wrote to you the output was #name;

now if i invoke the function in excel it just say's that there is no
argument in parentheses...that's not possible...

"Bob Phillips" wrote:

Works fine here. I presume you are using it in a worksheet? What do you get?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Kathl" wrote in message
...
hi, don't know what's wrong with this function. it shall take the value of
a
cell and via select case look, whats in it and write into the active cell
a
certain text.

Function PreTimeSlotsConv18(PreSlot18)
Select Case PreSlot18
Case "Slot 1"
PreTimeSlotsConv18 = "17:35"
Case "Slot 2"
PreTimeSlotsConv18 = "17:20"
Case "Slot3"
PreTimeSlotsConv18 = "17:05"
End Select
End Function

cheers




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default function for looking up text

Hi,

If you have no argument - cell reference - in the formula then you'll get
#value! error

Mike

"Kathl" wrote:

now i'm really getting lunatic...

before i wrote to you the output was #name;

now if i invoke the function in excel it just say's that there is no
argument in parentheses...that's not possible...

"Bob Phillips" wrote:

Works fine here. I presume you are using it in a worksheet? What do you get?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Kathl" wrote in message
...
hi, don't know what's wrong with this function. it shall take the value of
a
cell and via select case look, whats in it and write into the active cell
a
certain text.

Function PreTimeSlotsConv18(PreSlot18)
Select Case PreSlot18
Case "Slot 1"
PreTimeSlotsConv18 = "17:35"
Case "Slot 2"
PreTimeSlotsConv18 = "17:20"
Case "Slot3"
PreTimeSlotsConv18 = "17:05"
End Select
End Function

cheers






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default function for looking up text

A #NAME? error? It sounds like you do not have the function located in a
Module... functions for use in worksheet formulas must be located on a
regular Module (not Class Module).

Rick


"Kathl" wrote in message
...
now i'm really getting lunatic...

before i wrote to you the output was #name;

now if i invoke the function in excel it just say's that there is no
argument in parentheses...that's not possible...

"Bob Phillips" wrote:

Works fine here. I presume you are using it in a worksheet? What do you
get?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Kathl" wrote in message
...
hi, don't know what's wrong with this function. it shall take the value
of
a
cell and via select case look, whats in it and write into the active
cell
a
certain text.

Function PreTimeSlotsConv18(PreSlot18)
Select Case PreSlot18
Case "Slot 1"
PreTimeSlotsConv18 = "17:35"
Case "Slot 2"
PreTimeSlotsConv18 = "17:20"
Case "Slot3"
PreTimeSlotsConv18 = "17:05"
End Select
End Function

cheers





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
using a conditional suffix in text function format syntax=text(value,format_text) Brotherharry Excel Worksheet Functions 1 January 13th 09 03:03 PM
Can Text Function change output text color? epiekarc Excel Discussion (Misc queries) 1 December 31st 08 02:58 AM
Advanced text function (combining text) Johan[_2_] Excel Worksheet Functions 2 March 27th 08 10:05 PM
Using Concatenate function to generate text in Text Box Mary S. Charts and Charting in Excel 1 December 14th 05 08:55 PM
Macro or Function to make text size to suite text Length? lbbss Excel Discussion (Misc queries) 4 December 14th 04 07:53 PM


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