TIME reference - excel 2003

xFiruath

New Member
Joined
Nov 11, 2005
Messages
4
Hey again everyone!

In my last post I had a problem using the Time() function in Excel 2003. I was advised to change the code to use the Format function in conjunction with the now() function instead, which worked, for a little while. Now it's not working again, and the reason has something to do with the TIME reference. The first time I run the macro after opening the spreadsheet, it won't work, and I get an error that highlights the following code :

RightNow = Format(Now(), "Hh")

(RightNow is a variable declared at the beginning of the macro). If I move the TIME reference up or down, any amount of spaces, on the references table, and then rerun the macro, it works PERFECTLY. No errors, no problems, nothing.

This has me perplexed, because if I close the file down, and open in again, the SAME thing happens. Doesn't work the first time, then if I move the TIME reference at all, in any direction, it works just fine.

How do I fix this so it works all the time, without having to move the reference every time I want to run the macro??
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I post in more than one message board because I rarely get useable answers in only one board. (For example, I NEVER get a good answer at officekb.com, and only rarely at tek-tips.com)

As I posted in the forum you have linked to, I cannot find any reference flagged as MISSING. Where am I supposed to be seeing this??
 
Upvote 0
Post all of your code. But I will only answer at one forum, as I started with Colo's that's where I'll answer any further questions. Next time you cross-post, put a link to the other post please.
 
Upvote 0

Forum statistics

Threads
1,203,472
Messages
6,055,610
Members
444,803
Latest member
retrorocket129

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top