LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Dominic Olivastro
 
Posts: n/a
Default Setting NumberFormat within a VBA Module

I just wrote a function that returns a variant, instanced as either a string
("N/A") or a date. But I noticed it appears as a number in the spreadsheet.
So I figure I could format the cell right within the function, using:

ActiveCell.NumberFormat = "yyyy-mm-dd"

It doesn't work. When I insert after this statement, the following:
debug.print (ActiveCell.NumberFormat)

I find that it is still general. The odd thing is, if I write another
function that only sets the active cell to the proper format, it works fine.

Any ideas?
Dom


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference in the listing of the New module addition in 2002 version Hari Excel Discussion (Misc queries) 2 January 4th 05 06:56 AM
Access Module coded converted to Excel Function Adam Excel Discussion (Misc queries) 1 December 23rd 04 02:48 PM
Setting macro security level to "low" permanently? Arobind Excel Discussion (Misc queries) 1 December 22nd 04 01:41 AM
Setting default pivot table field setting to "sum" Mr. Moose Excel Discussion (Misc queries) 2 December 21st 04 04:43 PM
Is there any specific setting for MS excel to download CSV in fin. MikeDb Excel Discussion (Misc queries) 1 December 7th 04 05:37 PM


All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"