ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change function to macro (https://www.excelbanter.com/excel-programming/324442-change-function-macro.html)

Brian

Change function to macro
 
I have a simple function which compares a datafield on 2 separate worksheets
in same book. How do I take the code for the funct. and convert it to a macro
so I can call it as needed for all of my work?

thx

Bob

Change function to macro
 
You don't convert it to a macro. The best way I know to be able to access
your function regardless of what workbook you are using is to create an
add-in and then attach the add-in to Excel. One way to do this is:

Open a blank workbook
Add your function code to a module in this workbook.
Save the workbook as an addin: Select "Save as" with a meaningful file name
and then select "Microsoft Excel Add-n(*.xla) from the Save as Type drop down
box.

Then Select Tools, Add-Ins and browse to the file you just created.

Now you can use the function by typing it in a cell or by selecting in under
User Defined Functions in the Function Wizard.

"Brian" wrote:

I have a simple function which compares a datafield on 2 separate worksheets
in same book. How do I take the code for the funct. and convert it to a macro
so I can call it as needed for all of my work?

thx


Bob Phillips[_6_]

Change function to macro
 
Why can't you call a function for all of your work?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Brian" wrote in message
...
I have a simple function which compares a datafield on 2 separate

worksheets
in same book. How do I take the code for the funct. and convert it to a

macro
so I can call it as needed for all of my work?

thx





All times are GMT +1. The time now is 03:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com