Formatting Time to Include Milliseconds

rob51852

Board Regular
Joined
Jun 27, 2016
Messages
191
Office Version
  1. 2016
Platform
  1. Windows
Hi guys,

I have a macro that copy/pastes values from a sheet that gets updated a few times a second. New values overwrite existing values in the source sheet.

One of the values is a time which includes milliseconds. The source cell is formatted as dd:mm:yyyy hh:mm.000 and the paste range is formatted in the same way but if you look at the extract below you can see that the pasted time values are not correct.

On each refresh the macro pastes the data for MarketIDs 1-8. On the first refresh the time is 14:29:812, on the second refresh it is 14:29:813 then on the third refresh it goes down to 14:29:812. It then goes to 14:29:815 on the fourth refresh and back down to 14:29:814 on the fifth refresh.

There are two issues:

1. the macro actually only pastes the data once each second

2. the values are not sequential.

Can anyone suggest what the issue might be?

Thanks


Book1
AB
1MarketIDDate/Time
2
3124/07/2020 14:29:02
4224/07/2020 14:29:02
5324/07/2020 14:29:02
6424/07/2020 14:29:02
7524/07/2020 14:29:02
8624/07/2020 14:29:02
9724/07/2020 14:29:02
10824/07/2020 14:29:02
11124/07/2020 14:29:03
12224/07/2020 14:29:03
13324/07/2020 14:29:03
14424/07/2020 14:29:03
15524/07/2020 14:29:03
16624/07/2020 14:29:03
17724/07/2020 14:29:03
18824/07/2020 14:29:03
19124/07/2020 14:29:04
20224/07/2020 14:29:04
21324/07/2020 14:29:04
22424/07/2020 14:29:04
23524/07/2020 14:29:04
24624/07/2020 14:29:04
25724/07/2020 14:29:04
26824/07/2020 14:29:04
27124/07/2020 14:29:05
28224/07/2020 14:29:05
29324/07/2020 14:29:05
30424/07/2020 14:29:05
31524/07/2020 14:29:05
32624/07/2020 14:29:05
33724/07/2020 14:29:05
34824/07/2020 14:29:05
35124/07/2020 14:29:06
36224/07/2020 14:29:06
37324/07/2020 14:29:06
38424/07/2020 14:29:06
39524/07/2020 14:29:06
40624/07/2020 14:29:06
41724/07/2020 14:29:06
42824/07/2020 14:29:06
43124/07/2020 14:29:07
44224/07/2020 14:29:07
45324/07/2020 14:29:07
46424/07/2020 14:29:07
47524/07/2020 14:29:07
48624/07/2020 14:29:07
49724/07/2020 14:29:07
50824/07/2020 14:29:07
51124/07/2020 14:29:08
52224/07/2020 14:29:08
53324/07/2020 14:29:08
54424/07/2020 14:29:08
55524/07/2020 14:29:08
56624/07/2020 14:29:08
57724/07/2020 14:29:08
58824/07/2020 14:29:08
59124/07/2020 14:29:09
60224/07/2020 14:29:09
61324/07/2020 14:29:09
62424/07/2020 14:29:09
63524/07/2020 14:29:09
64624/07/2020 14:29:09
65724/07/2020 14:29:09
66824/07/2020 14:29:09
67124/07/2020 14:29:10
68224/07/2020 14:29:10
69324/07/2020 14:29:10
70424/07/2020 14:29:10
71524/07/2020 14:29:10
72624/07/2020 14:29:10
73724/07/2020 14:29:10
74824/07/2020 14:29:10
75124/07/2020 14:29:11
76224/07/2020 14:29:11
77324/07/2020 14:29:11
78424/07/2020 14:29:11
79524/07/2020 14:29:11
80624/07/2020 14:29:11
81724/07/2020 14:29:11
82824/07/2020 14:29:11
83124/07/2020 14:29:12
84224/07/2020 14:29:12
85324/07/2020 14:29:12
86424/07/2020 14:29:12
87524/07/2020 14:29:12
88624/07/2020 14:29:12
89724/07/2020 14:29:12
90824/07/2020 14:29:12
91124/07/2020 14:29:13
92224/07/2020 14:29:13
93324/07/2020 14:29:13
94424/07/2020 14:29:13
95524/07/2020 14:29:13
96624/07/2020 14:29:13
97724/07/2020 14:29:13
98824/07/2020 14:29:13
99124/07/2020 14:29:14
100224/07/2020 14:29:14
101324/07/2020 14:29:14
102424/07/2020 14:29:14
103524/07/2020 14:29:14
104624/07/2020 14:29:14
105724/07/2020 14:29:14
106824/07/2020 14:29:14
107124/07/2020 14:29:15
108224/07/2020 14:29:15
109324/07/2020 14:29:15
110424/07/2020 14:29:15
111524/07/2020 14:29:15
112624/07/2020 14:29:15
113724/07/2020 14:29:15
114824/07/2020 14:29:15
115124/07/2020 14:29:16
116224/07/2020 14:29:16
117324/07/2020 14:29:16
118424/07/2020 14:29:16
119524/07/2020 14:29:16
120624/07/2020 14:29:16
121724/07/2020 14:29:16
122824/07/2020 14:29:16
123124/07/2020 14:29:17
124224/07/2020 14:29:17
125324/07/2020 14:29:17
126424/07/2020 14:29:17
127524/07/2020 14:29:17
128624/07/2020 14:29:17
129724/07/2020 14:29:17
130824/07/2020 14:29:17
131124/07/2020 14:29:18
132224/07/2020 14:29:18
133324/07/2020 14:29:18
134424/07/2020 14:29:18
135524/07/2020 14:29:18
136624/07/2020 14:29:18
137724/07/2020 14:29:18
138824/07/2020 14:29:18
139124/07/2020 14:29:19
140224/07/2020 14:29:19
141324/07/2020 14:29:19
142424/07/2020 14:29:19
143524/07/2020 14:29:19
144624/07/2020 14:29:19
145724/07/2020 14:29:19
146824/07/2020 14:29:19
147124/07/2020 14:29:20
148224/07/2020 14:29:20
149324/07/2020 14:29:20
150424/07/2020 14:29:20
151524/07/2020 14:29:20
152624/07/2020 14:29:20
153724/07/2020 14:29:20
154824/07/2020 14:29:20
155124/07/2020 14:29:21
156224/07/2020 14:29:21
157324/07/2020 14:29:21
158424/07/2020 14:29:21
159524/07/2020 14:29:21
160624/07/2020 14:29:21
161724/07/2020 14:29:21
162824/07/2020 14:29:21
163124/07/2020 14:29:22
164224/07/2020 14:29:22
165324/07/2020 14:29:22
166424/07/2020 14:29:22
167524/07/2020 14:29:22
168624/07/2020 14:29:22
169724/07/2020 14:29:22
170824/07/2020 14:29:22
171124/07/2020 14:29:23
172224/07/2020 14:29:23
173324/07/2020 14:29:23
174424/07/2020 14:29:23
175524/07/2020 14:29:23
176624/07/2020 14:29:23
177724/07/2020 14:29:23
178824/07/2020 14:29:23
179124/07/2020 14:29:24
180224/07/2020 14:29:24
181324/07/2020 14:29:24
182424/07/2020 14:29:24
183524/07/2020 14:29:24
184624/07/2020 14:29:24
185724/07/2020 14:29:24
186824/07/2020 14:29:24
187124/07/2020 14:29:25
188224/07/2020 14:29:25
189324/07/2020 14:29:25
190424/07/2020 14:29:25
191524/07/2020 14:29:25
192624/07/2020 14:29:25
193724/07/2020 14:29:25
194824/07/2020 14:29:25
195124/07/2020 14:29:26
196224/07/2020 14:29:26
197324/07/2020 14:29:26
198424/07/2020 14:29:26
199524/07/2020 14:29:26
200624/07/2020 14:29:26
201724/07/2020 14:29:26
202824/07/2020 14:29:26
203124/07/2020 14:29:27
204224/07/2020 14:29:27
205324/07/2020 14:29:27
206424/07/2020 14:29:27
207524/07/2020 14:29:27
208624/07/2020 14:29:27
209724/07/2020 14:29:27
210824/07/2020 14:29:27
211124/07/2020 14:29:28
212224/07/2020 14:29:28
213324/07/2020 14:29:28
214424/07/2020 14:29:28
215524/07/2020 14:29:28
216624/07/2020 14:29:28
217724/07/2020 14:29:28
218824/07/2020 14:29:28
219124/07/2020 14:29:29
220224/07/2020 14:29:29
221324/07/2020 14:29:29
222424/07/2020 14:29:29
223524/07/2020 14:29:29
224624/07/2020 14:29:29
225724/07/2020 14:29:29
226824/07/2020 14:29:29
227124/07/2020 14:29:30
228224/07/2020 14:29:30
229324/07/2020 14:29:30
230424/07/2020 14:29:30
231524/07/2020 14:29:30
232624/07/2020 14:29:30
233724/07/2020 14:29:30
234824/07/2020 14:29:30
235124/07/2020 14:29:31
236224/07/2020 14:29:31
237324/07/2020 14:29:31
238424/07/2020 14:29:31
239524/07/2020 14:29:31
240624/07/2020 14:29:31
241724/07/2020 14:29:31
242824/07/2020 14:29:31
243124/07/2020 14:29:32
244224/07/2020 14:29:32
245324/07/2020 14:29:32
246424/07/2020 14:29:32
247524/07/2020 14:29:32
248624/07/2020 14:29:32
249724/07/2020 14:29:32
250824/07/2020 14:29:32
251124/07/2020 14:29:33
252224/07/2020 14:29:33
253324/07/2020 14:29:33
254424/07/2020 14:29:33
255524/07/2020 14:29:33
256624/07/2020 14:29:33
257724/07/2020 14:29:33
258824/07/2020 14:29:33
259124/07/2020 14:29:34
260224/07/2020 14:29:34
261324/07/2020 14:29:34
262424/07/2020 14:29:34
263524/07/2020 14:29:34
264624/07/2020 14:29:34
265724/07/2020 14:29:34
266824/07/2020 14:29:34
267124/07/2020 14:29:35
268224/07/2020 14:29:35
269324/07/2020 14:29:35
270424/07/2020 14:29:35
271524/07/2020 14:29:35
272624/07/2020 14:29:35
273724/07/2020 14:29:35
274824/07/2020 14:29:35
275124/07/2020 14:29:36
276224/07/2020 14:29:36
277324/07/2020 14:29:36
278424/07/2020 14:29:36
279524/07/2020 14:29:36
280624/07/2020 14:29:36
281724/07/2020 14:29:36
282824/07/2020 14:29:36
283124/07/2020 14:29:37
284224/07/2020 14:29:37
285324/07/2020 14:29:37
286424/07/2020 14:29:37
287524/07/2020 14:29:37
288624/07/2020 14:29:37
289724/07/2020 14:29:37
290824/07/2020 14:29:37
291124/07/2020 14:29:38
292224/07/2020 14:29:38
293324/07/2020 14:29:38
294424/07/2020 14:29:38
295524/07/2020 14:29:38
296624/07/2020 14:29:38
297724/07/2020 14:29:38
298824/07/2020 14:29:38
299124/07/2020 14:29:39
300224/07/2020 14:29:39
301324/07/2020 14:29:39
302424/07/2020 14:29:39
303524/07/2020 14:29:39
304624/07/2020 14:29:39
305724/07/2020 14:29:39
306824/07/2020 14:29:39
307124/07/2020 14:29:40
308224/07/2020 14:29:40
309324/07/2020 14:29:40
310424/07/2020 14:29:40
311524/07/2020 14:29:40
312624/07/2020 14:29:40
313724/07/2020 14:29:40
314824/07/2020 14:29:40
315124/07/2020 14:29:41
316224/07/2020 14:29:41
317324/07/2020 14:29:41
318424/07/2020 14:29:41
319524/07/2020 14:29:41
320624/07/2020 14:29:41
321724/07/2020 14:29:41
322824/07/2020 14:29:41
323124/07/2020 14:29:42
324224/07/2020 14:29:42
325324/07/2020 14:29:42
326424/07/2020 14:29:42
327524/07/2020 14:29:42
328624/07/2020 14:29:42
329724/07/2020 14:29:42
330824/07/2020 14:29:42
331124/07/2020 14:29:43
332224/07/2020 14:29:43
333324/07/2020 14:29:43
334424/07/2020 14:29:43
335524/07/2020 14:29:43
336624/07/2020 14:29:43
337724/07/2020 14:29:43
338824/07/2020 14:29:43
339124/07/2020 14:29:44
340224/07/2020 14:29:44
341324/07/2020 14:29:44
342424/07/2020 14:29:44
343524/07/2020 14:29:44
344624/07/2020 14:29:44
345724/07/2020 14:29:44
346824/07/2020 14:29:44
347124/07/2020 14:29:45
348224/07/2020 14:29:45
349324/07/2020 14:29:45
350424/07/2020 14:29:45
351524/07/2020 14:29:45
352624/07/2020 14:29:45
353724/07/2020 14:29:45
354824/07/2020 14:29:45
355124/07/2020 14:32:52
356224/07/2020 14:32:52
357324/07/2020 14:32:52
358424/07/2020 14:32:52
359524/07/2020 14:32:52
360624/07/2020 14:32:52
361724/07/2020 14:32:52
362824/07/2020 14:32:52
363124/07/2020 14:32:53
364224/07/2020 14:32:53
365324/07/2020 14:32:53
366424/07/2020 14:32:53
367524/07/2020 14:32:53
368624/07/2020 14:32:53
369724/07/2020 14:32:53
370824/07/2020 14:32:53
371124/07/2020 14:32:54
372224/07/2020 14:32:54
373324/07/2020 14:32:54
374424/07/2020 14:32:54
375524/07/2020 14:32:54
376624/07/2020 14:32:54
377724/07/2020 14:32:54
378824/07/2020 14:32:54
379124/07/2020 14:32:55
380224/07/2020 14:32:55
381324/07/2020 14:32:55
382424/07/2020 14:32:55
383524/07/2020 14:32:55
384624/07/2020 14:32:55
385724/07/2020 14:32:55
386824/07/2020 14:32:55
387124/07/2020 14:32:56
388224/07/2020 14:32:56
389324/07/2020 14:32:56
390424/07/2020 14:32:56
391524/07/2020 14:32:56
392624/07/2020 14:32:56
393724/07/2020 14:32:56
394824/07/2020 14:32:56
395124/07/2020 14:32:57
396224/07/2020 14:32:57
397324/07/2020 14:32:57
398424/07/2020 14:32:57
399524/07/2020 14:32:57
400624/07/2020 14:32:57
401724/07/2020 14:32:57
402824/07/2020 14:32:57
403124/07/2020 14:32:58
404224/07/2020 14:32:58
405324/07/2020 14:32:58
406424/07/2020 14:32:58
407524/07/2020 14:32:58
408624/07/2020 14:32:58
409724/07/2020 14:32:58
410824/07/2020 14:32:58
411124/07/2020 14:32:59
412224/07/2020 14:32:59
413324/07/2020 14:32:59
414424/07/2020 14:32:59
415524/07/2020 14:32:59
416624/07/2020 14:32:59
417724/07/2020 14:32:59
418824/07/2020 14:32:59
Data
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
The source cell is formatted as dd:mm:yyyy hh:mm.000
14:29:812

If your post is accurate then there are your problems, neither of those are valid formats.
Top one should be hh:mm:ss.000 (it does appear to work your way but is unstable, try formatting the cells before adding the data to them).
Bottom one is actually 14:42:32 (14 hours 29 minutes 812 seconds).
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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