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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how to? custom worksheet function using VBA



 
 
Thread Tools Display Modes
  #1  
Old September 20th, 2008, 03:01 AM posted to microsoft.public.excel.newusers
Fred Allen
external usenet poster
 
Posts: 3
Default how to? custom worksheet function using VBA

hello. new user here.

Is it possible to create "custom" worksheet functions in VBA in Excel 2007?

I used to do this quite easily in Excel 5. I can't find how to do this in
the new version.

This MS article doesn't seem to work for the 2007:
http://office.microsoft.com/en-us/ex...548461033.aspx

  #2  
Old September 20th, 2008, 03:45 AM posted to microsoft.public.excel.newusers
JP[_5_]
external usenet poster
 
Posts: 559
Default how to? custom worksheet function using VBA

I don't have Excel 2007, but doesn't it work the same way? You just
put the UDF in a standard code module in the workbook where it's going
to be used. For example:

Function MySum(intNum1 As Integer, intNum2 As Integer) As Integer
MySum = intNum1 + intNum2
End Function


Then just put "=MySum(1,2)" in your worksheet cell.

??

--JP

On Sep 19, 10:01*pm, "Fred Allen" wrote:
hello. new user here.

Is it possible to create "custom" worksheet functions in VBA in Excel 2007?

I used to do this quite easily in Excel 5. I can't find how to do this in
the new version.

This MS article doesn't seem to work for the 2007:http://office.microsoft..com/en-us/e...548461033.aspx


  #3  
Old September 20th, 2008, 04:36 PM posted to microsoft.public.excel.newusers
Fred Allen
external usenet poster
 
Posts: 3
Default how to? custom worksheet function using VBA

I did just that, and that is what the MS article says. So at least I know I
am on the right track (with VBA UDF, which operate differently than the old
XLM UDF). I guess it is some trick in Excel 2007 (or Vista).

Thank you for confirming how I thought it was supposed to work. That does
help!


"JP" wrote in message
...
I don't have Excel 2007, but doesn't it work the same way? You just
put the UDF in a standard code module in the workbook where it's going
to be used. For example:

Function MySum(intNum1 As Integer, intNum2 As Integer) As Integer
MySum = intNum1 + intNum2
End Function


Then just put "=MySum(1,2)" in your worksheet cell.

??

--JP

On Sep 19, 10:01 pm, "Fred Allen" wrote:
hello. new user here.

Is it possible to create "custom" worksheet functions in VBA in Excel
2007?

I used to do this quite easily in Excel 5. I can't find how to do this in
the new version.

This MS article doesn't seem to work for the
2007:http://office.microsoft.com/en-us/ex...548461033.aspx


  #4  
Old September 21st, 2008, 01:40 AM posted to microsoft.public.excel.newusers
Fred Allen
external usenet poster
 
Posts: 3
Default how to? custom worksheet function using VBA

Okay, the UDF has to be in a Module, it can't be in the code for a worksheet
or even ThisWorkbook.


"Fred Allen" wrote in message
...
I did just that, and that is what the MS article says. So at least I know I
am on the right track (with VBA UDF, which operate differently than the old
XLM UDF). I guess it is some trick in Excel 2007 (or Vista).

Thank you for confirming how I thought it was supposed to work. That does
help!


"JP" wrote in message
...
I don't have Excel 2007, but doesn't it work the same way? You just
put the UDF in a standard code module in the workbook where it's going
to be used. For example:

Function MySum(intNum1 As Integer, intNum2 As Integer) As Integer
MySum = intNum1 + intNum2
End Function


Then just put "=MySum(1,2)" in your worksheet cell.

??

--JP

On Sep 19, 10:01 pm, "Fred Allen" wrote:
hello. new user here.

Is it possible to create "custom" worksheet functions in VBA in Excel
2007?

I used to do this quite easily in Excel 5. I can't find how to do this in
the new version.

This MS article doesn't seem to work for the
2007:http://office.microsoft.com/en-us/ex...548461033.aspx



  #5  
Old September 21st, 2008, 12:48 PM posted to microsoft.public.excel.newusers
JP[_5_]
external usenet poster
 
Posts: 559
Default how to? custom worksheet function using VBA

Sorry Fred, I just realized your first post mentioned Excel 5, where
the method for creating UDFs might have been radically different. Yes
you put the code in a standard module by pressing Alt-F11 to access
the VBIDE, then going to Insert Module in the workbook in which you
want to use the function.


On Sep 20, 8:40*pm, "Fred Allen" wrote:
Okay, the UDF has to be in a Module, it can't be in the code for a worksheet
or even ThisWorkbook.

"Fred Allen" wrote in message

...



I did just that, and that is what the MS article says. So at least I know I
am on the right track (with VBA UDF, which operate differently than the old
XLM UDF). I guess it is some trick in Excel 2007 (or Vista).


Thank you for confirming how I thought it was supposed to work. That does
help!


 




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:21 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.