Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

format calling cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RedLars - 24 Mar 2008 11:50 GMT
Hi,

When calling a macro from a cell in excel, how can I set the format of
that cell to use for instance Date dd.mm.yyyy ? Do I need to supply
location of the cell I want to format (using Range?) ? Would
appreciate any example.

Thanks.
Jarek Kujawa - 24 Mar 2008 11:54 GMT
i am not sure what your are up to, could you be more specific?

there are cases when it is not necessary to supply the location by
showing address
Jarek Kujawa - 24 Mar 2008 11:57 GMT
one way:

ActiveCell.NumberFormat = "dd.mm.yyyy;@"

what do you mean by "calling a macro from a cell"?
RedLars - 24 Mar 2008 15:30 GMT
> one way:
>
> ActiveCell.NumberFormat = "dd.mm.yyyy;@"
>
> what do you mean by "calling a macro from a cell"?

Thanks for your reply.

I apologise for the rather quickly written post.

In a few cells in excel I will parse a string into a date format and
would also like to set the format of that cell to Date (dd.mm.yyyy)
using vba.

So for instance in cell B4 I would write =FormatCell(L4). L4 would
then contain a text which will contain a date (and possibly other
text). The purpose of FormatCell is to parse the text but if the
format of the cell (B4) is not of type date the displayed value is
wrong (using the format "standard" give the following output 39432,
but using the format "date" give me the correct output of
16.12.2007).

Will give your example a try.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.