Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

function for looking up text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kathl - 14 Mar 2008 16:11 GMT
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
Bob Phillips - 14 Mar 2008 16:20 GMT
Works fine here. I presume you are using it in a worksheet? What do you get?

Signature

---
HTH

Bob

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

> hi, don't know what's wrong with this function. it shall take the value of
> a
[quoted text clipped - 14 lines]
>
> cheers
Kathl - 14 Mar 2008 16:50 GMT
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...

> Works fine here. I presume you are using it in a worksheet? What do you get?
>
[quoted text clipped - 16 lines]
> >
> > cheers
Mike H - 14 Mar 2008 17:10 GMT
Hi,

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

Mike

> now i'm really getting lunatic...
>
[quoted text clipped - 23 lines]
> > >
> > > cheers
Rick Rothstein (MVP - VB) - 14 Mar 2008 17:24 GMT
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

> now i'm really getting lunatic...
>
[quoted text clipped - 26 lines]
>> >
>> > cheers
Mike H - 14 Mar 2008 16:21 GMT
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

> 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
[quoted text clipped - 12 lines]
>
> cheers
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.