Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem in Vba excel

Status
Not open for further replies.

kkgusta

MIS
Nov 10, 2005
42
NZ
Hi there,
I have created a UDF to calculate some date for my spreadsheet. Now I am trying add more features to my UDF which is every time when I user the function in the cell the selected cell format will be updated to date and the font colour will change to RED. I have been trying to look for answer in Google but I couldn't find one. Does anyone of you here know the solution?

 
hi
i might be wrong (or just outdated) about this but I'm fairly sure you can't manipulate xl objects from a function.

you might be able to put the formatting code into a sub and call that from the function but i've never tried it.

;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 
correct - a UDF on a sheet cannot change any of the properties - it can only return a value

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top