code for time of less than 1 second please

Derek

Well-known Member
Joined
Feb 16, 2002
Messages
1,595
Hi all

I am using this code to slow my macro:
Application.Wait Now + TimeValue("00:00:01")
for a wait time of one second. I should like to reduce this to one tenth of a second.
Please can someone tell me how I should word the code for this.
Many thanks
regards
Derek
This message was edited by Derek on 2002-05-28 17:10
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
How about a number format of hh:mm:ss.000?

Actually, it still requires me truncating the column at xx:xx:xx.248 to start the next second's labels. I think it needs to be in 1/248th of a second so that when 248th entry happens it automatically rolls over to the next second.
 
Upvote 0
Actually, it still requires me truncating the column at xx:xx:xx.248 to start the next second's labels. I think it needs to be in 1/248th of a second so that when 248th entry happens it automatically rolls over to the next second.

Also, trying to increase the decimal points yields an error saying Excel cannot use that value. So .000 is the max clarity. I would like to use 1/248th = .0040322 so that 248 rows will equal 1 second and just pulling the copy and paste corner will put in correct number of labels.
 
Upvote 0
Two points:

1. The maximum display resolution is hh:mm:ss.000, but Excel stores more digits.

2. Each cell has a distinct displayed value, separated by 0.004... from the previous value.

An Excel date is stored as the number of days since 1/1/1900, give or take a leap year approximation in 1900, and an Excel time is the fraction of a day since midnight. To add 1/248 of a second, you have to add 1/(248*60) of a minute, 1/(248*60*60) of an hour, or 1/(246*60*60*24) of a day. If you add 1/(246*60*60*24) to an Excel date-time value, you will be adding 1/248 seconds.
 
Upvote 0
Two points:

1. The maximum display resolution is hh:mm:ss.000, but Excel stores more digits.

2. Each cell has a distinct displayed value, separated by 0.004... from the previous value.

An Excel date is stored as the number of days since 1/1/1900, give or take a leap year approximation in 1900, and an Excel time is the fraction of a day since midnight. To add 1/248 of a second, you have to add 1/(248*60) of a minute, 1/(248*60*60) of an hour, or 1/(246*60*60*24) of a day. If you add 1/(246*60*60*24) to an Excel date-time value, you will be adding 1/248 seconds.

HA! Worked. Thanks.
 
Upvote 0

Forum statistics

Threads
1,223,247
Messages
6,171,007
Members
452,374
Latest member
keccles

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