Forum Discussion
JGB82
Jan 11, 2023Copper Contributor
UDF not working in Excel 365
I have made a new funcion via VBA and put it in its own module, so not in the workbook or something, I made a new module. It's a function for giving back the background color code of a selected cell...
mtarler
Jan 11, 2023Silver Contributor
also note certain folder are 'blocked' from being trusted/allowed like Downloads folder. So make sure you are not using that.
mtarler
Jan 11, 2023Silver Contributor
JGB82 BTW I would suggest a couple tweaks to the UDF
Function NumColor(cell As Range) As Long
NumColor = cell.Cells(1, 1).Interior.Color
End Functionfirst will define the output format (long) and the second will have the function return the FIRST cell if a range is passed to the function