User defined functions

Jeff S Hendricks

New Member
Joined
Aug 25, 2002
Messages
1
Am I just dreaming or is there a way to create my own functions (i.e. "function 1")where I can type in a formula like the following

=function1(range)

and have it perform several operations to the range that I specify?
Thanks.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi Jeff,

Yes, you can create your own functions in VBA They are called user-defined functions (UDFs). If you search this message board for UDF I'll bet you get lots of examples of how to write them. You can also get help from the Excel VBA helps under the heading "Function".

Damon
 
Upvote 0
Depends...
if you want to take a range, perform some operation(s) ON it, and display the result in a new cell, then yes, you can create your function1(range) using VBA.

If you want the function to operate on the input range and modify it right in place, then I'm afraid you _are_ dreaming :) .. a function can do precious little by way of modifying a worksheet.
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,614
Members
449,090
Latest member
vivek chauhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top