Hi gurus
I was just wondering if there was a directive that can work out if a subroutine or function (UDF) is defined in another VBA module within a workbook.
I have several modules that I often attach to workbooks; sometimes individually and sometimes together. Sometimes I use the same function within multiple modules so I don't have to include lots of unnecessary code
If the same UDF name is defined in multiple modules, using the function name in a sheet formula seems to result in an "amgiguous name" error even if said function is defined as private within the module.
Am I missing something here, or is there some #IF directive (or similar) that can check if the function is already defined in another module so it can be excluded.
Excel sheet formulas don't seem to respect the 'private' definition of functions within modules.
Something like
#IF DEFINED udf_name then
! Do nothing
#ELSE
function udf_name()
... code
end function
#ENDIF
I was just wondering if there was a directive that can work out if a subroutine or function (UDF) is defined in another VBA module within a workbook.
I have several modules that I often attach to workbooks; sometimes individually and sometimes together. Sometimes I use the same function within multiple modules so I don't have to include lots of unnecessary code
If the same UDF name is defined in multiple modules, using the function name in a sheet formula seems to result in an "amgiguous name" error even if said function is defined as private within the module.
Am I missing something here, or is there some #IF directive (or similar) that can check if the function is already defined in another module so it can be excluded.
Excel sheet formulas don't seem to respect the 'private' definition of functions within modules.
Something like
#IF DEFINED udf_name then
! Do nothing
#ELSE
function udf_name()
... code
end function
#ENDIF