Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Four User Defined Functions - probably one similar answer

I want a set of "function" for convertions, eg if I enter =MPH() in a cell it
will assume the current value or referenced cell is KPH and will enter the
corrent MPH figure, conversely I would like to be able to do the reverse
=KPH(). Saves me having to enter conversion rate calculation each time. Also
would it be possible for =Centigrade() and =Farenheit(), although here the
conversion is more complex. (I generally use /5*9 +32).
Please advise whereabouts in the VBA these would need to be placed
Many Thanks
Paul
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Four User Defined Functions - probably one similar answer

Hi,

These should do

Function kphmph(rng As Range)
kphmph = rng.Value * 0.62137119
End Function

Function mphkph(rng As Range)
mphkph = rng.Value * 1.609344
End Function

Function CF(rng As Range)
CF = (rng.Value * 1.8) + 32
End Function

Function FC(rng As Range)
FC = (rng.Value - 32) * 0.555556
End Function


Mike

"Paul Moles" wrote:

I want a set of "function" for convertions, eg if I enter =MPH() in a cell it
will assume the current value or referenced cell is KPH and will enter the
corrent MPH figure, conversely I would like to be able to do the reverse
=KPH(). Saves me having to enter conversion rate calculation each time. Also
would it be possible for =Centigrade() and =Farenheit(), although here the
conversion is more complex. (I generally use /5*9 +32).
Please advise whereabouts in the VBA these would need to be placed
Many Thanks
Paul

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Four User Defined Functions - probably one similar answer

I missed the 'where'.

Alt +F11 to open VB editor. Right click 'This Workbook' and insert module.
Paste them in on the right.

Mike

"Mike H" wrote:

Hi,

These should do

Function kphmph(rng As Range)
kphmph = rng.Value * 0.62137119
End Function

Function mphkph(rng As Range)
mphkph = rng.Value * 1.609344
End Function

Function CF(rng As Range)
CF = (rng.Value * 1.8) + 32
End Function

Function FC(rng As Range)
FC = (rng.Value - 32) * 0.555556
End Function


Mike

"Paul Moles" wrote:

I want a set of "function" for convertions, eg if I enter =MPH() in a cell it
will assume the current value or referenced cell is KPH and will enter the
corrent MPH figure, conversely I would like to be able to do the reverse
=KPH(). Saves me having to enter conversion rate calculation each time. Also
would it be possible for =Centigrade() and =Farenheit(), although here the
conversion is more complex. (I generally use /5*9 +32).
Please advise whereabouts in the VBA these would need to be placed
Many Thanks
Paul

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Four User Defined Functions - probably one similar answer

Thanks Mike
Have stored in my Personal Workbook
Thanks
Paul

"Mike H" wrote:

Hi,

These should do

Function kphmph(rng As Range)
kphmph = rng.Value * 0.62137119
End Function

Function mphkph(rng As Range)
mphkph = rng.Value * 1.609344
End Function

Function CF(rng As Range)
CF = (rng.Value * 1.8) + 32
End Function

Function FC(rng As Range)
FC = (rng.Value - 32) * 0.555556
End Function


Mike

"Paul Moles" wrote:

I want a set of "function" for convertions, eg if I enter =MPH() in a cell it
will assume the current value or referenced cell is KPH and will enter the
corrent MPH figure, conversely I would like to be able to do the reverse
=KPH(). Saves me having to enter conversion rate calculation each time. Also
would it be possible for =Centigrade() and =Farenheit(), although here the
conversion is more complex. (I generally use /5*9 +32).
Please advise whereabouts in the VBA these would need to be placed
Many Thanks
Paul

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Four User Defined Functions - probably one similar answer

Do you know how/where to enter the "Help" text that explains what a function
does?
Cheers
Paul

"Mike H" wrote:

I missed the 'where'.

Alt +F11 to open VB editor. Right click 'This Workbook' and insert module.
Paste them in on the right.

Mike

"Mike H" wrote:

Hi,

These should do

Function kphmph(rng As Range)
kphmph = rng.Value * 0.62137119
End Function

Function mphkph(rng As Range)
mphkph = rng.Value * 1.609344
End Function

Function CF(rng As Range)
CF = (rng.Value * 1.8) + 32
End Function

Function FC(rng As Range)
FC = (rng.Value - 32) * 0.555556
End Function


Mike

"Paul Moles" wrote:

I want a set of "function" for convertions, eg if I enter =MPH() in a cell it
will assume the current value or referenced cell is KPH and will enter the
corrent MPH figure, conversely I would like to be able to do the reverse
=KPH(). Saves me having to enter conversion rate calculation each time. Also
would it be possible for =Centigrade() and =Farenheit(), although here the
conversion is more complex. (I generally use /5*9 +32).
Please advise whereabouts in the VBA these would need to be placed
Many Thanks
Paul



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Four User Defined Functions - probably one similar answer

Paul,

This is for Excel 2003 and you must be in the workbook where the macro is

Tools|Macro|Macros
You get a list of macros but don't worry that these UDF's don't appear
because Excel is aware of them
Type the name of the UDF you want help for and click Options and enter your
description. Click OK
Now you have to click Cancel (Yes Cancel) and your done.

Next time you use the function wizard you should get your help text

Mike


"Paul Moles" wrote:

Do you know how/where to enter the "Help" text that explains what a function
does?
Cheers
Paul

"Mike H" wrote:

I missed the 'where'.

Alt +F11 to open VB editor. Right click 'This Workbook' and insert module.
Paste them in on the right.

Mike

"Mike H" wrote:

Hi,

These should do

Function kphmph(rng As Range)
kphmph = rng.Value * 0.62137119
End Function

Function mphkph(rng As Range)
mphkph = rng.Value * 1.609344
End Function

Function CF(rng As Range)
CF = (rng.Value * 1.8) + 32
End Function

Function FC(rng As Range)
FC = (rng.Value - 32) * 0.555556
End Function


Mike

"Paul Moles" wrote:

I want a set of "function" for convertions, eg if I enter =MPH() in a cell it
will assume the current value or referenced cell is KPH and will enter the
corrent MPH figure, conversely I would like to be able to do the reverse
=KPH(). Saves me having to enter conversion rate calculation each time. Also
would it be possible for =Centigrade() and =Farenheit(), although here the
conversion is more complex. (I generally use /5*9 +32).
Please advise whereabouts in the VBA these would need to be placed
Many Thanks
Paul

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Enter User Defined Function Help Text

Thanks Mike
That needs to be a highlighted answer as much of my searching said it wasn't
possible. Great.

"Mike H" wrote:

Paul,

This is for Excel 2003 and you must be in the workbook where the macro is

Tools|Macro|Macros
You get a list of macros but don't worry that these UDF's don't appear
because Excel is aware of them
Type the name of the UDF you want help for and click Options and enter your
description. Click OK
Now you have to click Cancel (Yes Cancel) and your done.

Next time you use the function wizard you should get your help text

Mike


"Paul Moles" wrote:

Do you know how/where to enter the "Help" text that explains what a function
does?
Cheers
Paul

"Mike H" wrote:

I missed the 'where'.

Alt +F11 to open VB editor. Right click 'This Workbook' and insert module.
Paste them in on the right.

Mike

"Mike H" wrote:

Hi,

These should do

Function kphmph(rng As Range)
kphmph = rng.Value * 0.62137119
End Function

Function mphkph(rng As Range)
mphkph = rng.Value * 1.609344
End Function

Function CF(rng As Range)
CF = (rng.Value * 1.8) + 32
End Function

Function FC(rng As Range)
FC = (rng.Value - 32) * 0.555556
End Function


Mike

"Paul Moles" wrote:

I want a set of "function" for convertions, eg if I enter =MPH() in a cell it
will assume the current value or referenced cell is KPH and will enter the
corrent MPH figure, conversely I would like to be able to do the reverse
=KPH(). Saves me having to enter conversion rate calculation each time. Also
would it be possible for =Centigrade() and =Farenheit(), although here the
conversion is more complex. (I generally use /5*9 +32).
Please advise whereabouts in the VBA these would need to be placed
Many Thanks
Paul

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Four User Defined Functions - probably one similar answer

Paul

If all you need is a line or two to describe the UDF try this.

ToolsMacroMacros

Type in the name of the UDF and "Options"

You can type in a couple of descriptive lines and OK then Cancel

...........................................

To fully customize your User Defined Functions....

See Laurent Longre's website for FUNCUSTOMIZE add-in.

ZIP file also includes a demo file and a how-to-use file.

http://longre.free.fr/english/index.html

Ballon Tips are not available with Laurent's method.


Gord Dibben MS Excel MVP

On Mon, 2 Jun 2008 03:44:00 -0700, Paul Moles
wrote:

Do you know how/where to enter the "Help" text that explains what a function
does?
Cheers
Paul

"Mike H" wrote:

I missed the 'where'.

Alt +F11 to open VB editor. Right click 'This Workbook' and insert module.
Paste them in on the right.

Mike

"Mike H" wrote:

Hi,

These should do

Function kphmph(rng As Range)
kphmph = rng.Value * 0.62137119
End Function

Function mphkph(rng As Range)
mphkph = rng.Value * 1.609344
End Function

Function CF(rng As Range)
CF = (rng.Value * 1.8) + 32
End Function

Function FC(rng As Range)
FC = (rng.Value - 32) * 0.555556
End Function


Mike

"Paul Moles" wrote:

I want a set of "function" for convertions, eg if I enter =MPH() in a cell it
will assume the current value or referenced cell is KPH and will enter the
corrent MPH figure, conversely I would like to be able to do the reverse
=KPH(). Saves me having to enter conversion rate calculation each time. Also
would it be possible for =Centigrade() and =Farenheit(), although here the
conversion is more complex. (I generally use /5*9 +32).
Please advise whereabouts in the VBA these would need to be placed
Many Thanks
Paul


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
User Defined Functions CH Excel Worksheet Functions 4 September 22nd 08 10:16 AM
User defined functions without using VBA. [email protected] New Users to Excel 0 June 13th 06 05:55 PM
User defined functions without using VBA. [email protected] Excel Discussion (Misc queries) 0 June 13th 06 05:50 PM
User Defined Functions Jeff B Excel Worksheet Functions 1 April 27th 05 09:59 PM
User Defined Functions Frank@shell Excel Worksheet Functions 3 April 20th 05 02:41 PM


All times are GMT +1. The time now is 12:46 PM.

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"