Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
is there anyway to insert a macro that puts a macro into another
file.. i currently have a macro that opens up other excel files.. I need to insert a UDF into those xls files.. is there anyway to make a macro create a module and insert code? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi mithu
See this page from Chip Pearson http://www.cpearson.com/excel/vbe.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "mithu" wrote in message oups.com... is there anyway to insert a macro that puts a macro into another file.. i currently have a macro that opens up other excel files.. I need to insert a UDF into those xls files.. is there anyway to make a macro create a module and insert code? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The reason i need this is because i am editing a folder with out 300
excel files.. i know how to access all files one at a time. i need to extract a number from cell a1 which is usually something like "company name 34222 dkafaf" where i am extracting those numbers in this case 34222. i was told to use this function below in conjunction with vlookup.. so like =vlookup(numberit(a1).....) this works great.. but i need this function in all my files for it to work. Function NumberIt(CompanyCell As Range) As Double C = CompanyCell.Value For x = 1 To Len(C) If IsNumeric(Mid(C, x, 1)) Then n = n & Mid(C, x, 1) Next x NumberIt = --n End Function i place this function in my main excel spreadsheet that i run the macro from.. it works fine if one of the files i am editing has that function in it.. but it wont if it doesnt have that function.. so i am trying to write a code that will add module and add this numberIT function to each of the spreadsheets.. i hope this makes sense.. please let me know if there is an easier way. On Mar 19, 2:47 pm, "mithu" wrote: is there anyway to insert a macro that puts a macro into another file.. i currently have a macro that opens up other excel files.. I need to insert a UDF into those xls files.. is there anyway to make a macro create a module and insert code? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Do you only want the values from A1 of every excel file in the folder ???
-- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "mithu" wrote in message ups.com... The reason i need this is because i am editing a folder with out 300 excel files.. i know how to access all files one at a time. i need to extract a number from cell a1 which is usually something like "company name 34222 dkafaf" where i am extracting those numbers in this case 34222. i was told to use this function below in conjunction with vlookup.. so like =vlookup(numberit(a1).....) this works great.. but i need this function in all my files for it to work. Function NumberIt(CompanyCell As Range) As Double C = CompanyCell.Value For x = 1 To Len(C) If IsNumeric(Mid(C, x, 1)) Then n = n & Mid(C, x, 1) Next x NumberIt = --n End Function i place this function in my main excel spreadsheet that i run the macro from.. it works fine if one of the files i am editing has that function in it.. but it wont if it doesnt have that function.. so i am trying to write a code that will add module and add this numberIT function to each of the spreadsheets.. i hope this makes sense.. please let me know if there is an easier way. On Mar 19, 2:47 pm, "mithu" wrote: is there anyway to insert a macro that puts a macro into another file.. i currently have a macro that opens up other excel files.. I need to insert a UDF into those xls files.. is there anyway to make a macro create a module and insert code? |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Yes. the company code is in A1 along with some text.. I am able to
extract it using that function. but i need to put that function in every spreadsheet. is there anyway to have a global function that will work on any spreadsheet i open? On Mar 19, 4:31 pm, "Ron de Bruin" wrote: Do you only want the values from A1 of every excel file in the folder ??? -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "mithu" wrote in oglegroups.com... The reason i need this is because i am editing a folder with out 300 excel files.. i know how to access all files one at a time. i need to extract a number from cell a1 which is usually something like "company name 34222 dkafaf" where i am extracting those numbers in this case 34222. i was told to use this function below in conjunction with vlookup.. so like =vlookup(numberit(a1).....) this works great.. but i need this function in all my files for it to work. Function NumberIt(CompanyCell As Range) As Double C = CompanyCell.Value For x = 1 To Len(C) If IsNumeric(Mid(C, x, 1)) Then n = n & Mid(C, x, 1) Next x NumberIt = --n End Function i place this function in my main excel spreadsheet that i run the macro from.. it works fine if one of the files i am editing has that function in it.. but it wont if it doesnt have that function.. so i am trying to write a code that will add module and add this numberIT function to each of the spreadsheets.. i hope this makes sense.. please let me know if there is an easier way. On Mar 19, 2:47 pm, "mithu" wrote: is there anyway to insert a macro that puts a macro into another file.. i currently have a macro that opens up other excel files.. I need to insert a UDF into those xls files.. is there anyway to make a macro create a module and insert code?- Hide quoted text - - Show quoted text - |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Yes you can put it in your personal.xls
http://www.rondebruin.nl/personal.htm If you only want to have the value of A1 of each workbook you can create links to the cells and then use the function in another cell. You not have to open the workbooks then See http://www.rondebruin.nl/summary.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "mithu" wrote in message ups.com... Yes. the company code is in A1 along with some text.. I am able to extract it using that function. but i need to put that function in every spreadsheet. is there anyway to have a global function that will work on any spreadsheet i open? On Mar 19, 4:31 pm, "Ron de Bruin" wrote: Do you only want the values from A1 of every excel file in the folder ??? -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "mithu" wrote in oglegroups.com... The reason i need this is because i am editing a folder with out 300 excel files.. i know how to access all files one at a time. i need to extract a number from cell a1 which is usually something like "company name 34222 dkafaf" where i am extracting those numbers in this case 34222. i was told to use this function below in conjunction with vlookup.. so like =vlookup(numberit(a1).....) this works great.. but i need this function in all my files for it to work. Function NumberIt(CompanyCell As Range) As Double C = CompanyCell.Value For x = 1 To Len(C) If IsNumeric(Mid(C, x, 1)) Then n = n & Mid(C, x, 1) Next x NumberIt = --n End Function i place this function in my main excel spreadsheet that i run the macro from.. it works fine if one of the files i am editing has that function in it.. but it wont if it doesnt have that function.. so i am trying to write a code that will add module and add this numberIT function to each of the spreadsheets.. i hope this makes sense.. please let me know if there is an easier way. On Mar 19, 2:47 pm, "mithu" wrote: is there anyway to insert a macro that puts a macro into another file.. i currently have a macro that opens up other excel files.. I need to insert a UDF into those xls files.. is there anyway to make a macro create a module and insert code?- Hide quoted text - - Show quoted text - |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks ron..
your the man On Mar 20, 11:02 am, "Ron de Bruin" wrote: Yes you can put it in your personal.xlshttp://www.rondebruin.nl/personal.htm If you only want to have the value of A1 of each workbook you can create links to the cells and then use the function in another cell. You not have to open the workbooks then Seehttp://www.rondebruin.nl/summary.htm -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "mithu" wrote in oglegroups.com... Yes. the company code is in A1 along with some text.. I am able to extract it using that function. but i need to put that function in every spreadsheet. is there anyway to have a global function that will work on any spreadsheet i open? On Mar 19, 4:31 pm, "Ron de Bruin" wrote: Do you only want the values from A1 of every excel file in the folder ??? -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "mithu" wrote in oglegroups.com... The reason i need this is because i am editing a folder with out 300 excel files.. i know how to access all files one at a time. i need to extract a number from cell a1 which is usually something like "company name 34222 dkafaf" where i am extracting those numbers in this case 34222. i was told to use this function below in conjunction with vlookup.. so like =vlookup(numberit(a1).....) this works great.. but i need this function in all my files for it to work. Function NumberIt(CompanyCell As Range) As Double C = CompanyCell.Value For x = 1 To Len(C) If IsNumeric(Mid(C, x, 1)) Then n = n & Mid(C, x, 1) Next x NumberIt = --n End Function i place this function in my main excel spreadsheet that i run the macro from.. it works fine if one of the files i am editing has that function in it.. but it wont if it doesnt have that function.. so i am trying to write a code that will add module and add this numberIT function to each of the spreadsheets.. i hope this makes sense.. please let me know if there is an easier way. On Mar 19, 2:47 pm, "mithu" wrote: is there anyway to insert a macro that puts a macro into another file.. i currently have a macro that opens up other excel files.. I need to insert a UDF into those xls files.. is there anyway to make a macro create a module and insert code?- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
DO NOT Insert Row - Macro | Excel Worksheet Functions | |||
Insert Row macro not working | Excel Discussion (Misc queries) | |||
Insert A Row Macro | New Users to Excel | |||
Insert Row with a macro | Excel Discussion (Misc queries) | |||
How to insert a Macro within a macro? | Excel Discussion (Misc queries) |