A little bug in my macro about time (excel 2007)

Ö

Özgür Arpaci

Hello,

I'm a senior computeruser from Belgium and I've made a macro where you can
only see the time but there is a little bug in it.
That bug shows up when I use my macro for the second time in a other cell.
When I used it for the second time, the cell where I used my macro for the
first time changes into the same time of the cell where I used my macro for
the second time.


This is how I made my macro: - I wrote in my formulebox --> =Nu()-Vandaag()

[translation --> =Now() - Today()]

- Then I clicked on the
birdie where I put my formula in.

- Then I changed the
notation to u:mm:ss

- Macro is ready

Everything worked except for that bug that mentioned earlier.

Can you help me?


Thanks in advance.
 
B

Bernie Deitrick

Change your macro to not use a formula in the cell:

ActiveCell.Value = Time
ActiveCell.NumberFormat = "h:mm:ss" ' or whatever format you like

HTH,
Bernie
MS Excel MVP
 
Ö

Özgür Arpaci

Thanks it helped me really good.

Bernie Deitrick said:
Change your macro to not use a formula in the cell:

ActiveCell.Value = Time
ActiveCell.NumberFormat = "h:mm:ss" ' or whatever format you like

HTH,
Bernie
MS Excel MVP


Özgür Arpaci said:
Hello,

I'm a senior computeruser from Belgium and I've made a macro where you
can only see the time but there is a little bug in it.
That bug shows up when I use my macro for the second time in a other
cell. When I used it for the second time, the cell where I used my macro
for the first time changes into the same time of the cell where I used my
macro for the second time.


This is how I made my macro: - I wrote in my formulebox -->
=Nu()-Vandaag()

[translation --> =Now() - Today()]

- Then I clicked on the
birdie where I put my formula in.

- Then I changed the
notation to u:mm:ss

- Macro is ready

Everything worked except for that bug that mentioned earlier.

Can you help me?


Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top