ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   UDF trouble (https://www.excelbanter.com/excel-discussion-misc-queries/44502-udf-trouble.html)

Ray A

UDF trouble
 
Hi
I have 2 user defined functions in my personal workbook.

Function GetFontColor(mycell As Range)

GetFontColor = mycell.Font.ColorIndex

End Function

Function GetFillColor(mycell As Range)

GetFillColor = mycell.Interior.ColorIndex

End Function

I have entered these formuilas
=getfillcolor(A1)
=getfontcolor(A1)
Both result in the #Name? error. What is the problem?
TIA

JE McGimpsey

Use:

=Personal.xls!GetFillColor(A1)

By default, Personal.xls is just a regular (though hidden) workbook, so
you need to use the workbook name.

Add-ins don't require the workbook prefix.



In article ,
"Ray A" wrote:

Hi
I have 2 user defined functions in my personal workbook.

Function GetFontColor(mycell As Range)

GetFontColor = mycell.Font.ColorIndex

End Function

Function GetFillColor(mycell As Range)

GetFillColor = mycell.Interior.ColorIndex

End Function

I have entered these formuilas
=getfillcolor(A1)
=getfontcolor(A1)
Both result in the #Name? error. What is the problem?
TIA



All times are GMT +1. The time now is 10:04 AM.

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