Date & Time Stamp when Macro Starts

glennjrobertson1980

New Member
Joined
Mar 30, 2015
Messages
12
Hi,

I have created some VBA code to run my spreadsheet. The code works perfectly.

However, I have a cell on a worksheet called "Data" the cell is D14 that I would like populated with the date and time that the macro started to run. I am struggling with this code. I have pasted my code below.

To confirm user has to start running macro manually I would like the above cell to populated to show the date and time that macro was started.

Many thanks in advance

Sub Macro1()
' This code will check all online SLM sites Pi data received. It will allow us
' to see when we last received comms with the unit.
With Application
.Calculation = xlCalculationManual
.MaxChange = 0.001
End With
For x = 1 To 311
Sheets("Data").Select
Cells(5, 4).Value = x
Calculate
Cells(23 + x, 6).Select
ActiveCell.FormulaR1C1 = "=R22C16"
Cells(23 + x, 7).Select
ActiveCell.FormulaR1C1 = "=R23C16"
Range(Selection, Selection.End(xlToLeft)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next x
Range("B22").Select
MsgBox ("SLM Data Return V4 Calculations Complete")
End Sub
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,215,338
Messages
6,124,349
Members
449,155
Latest member
ravioli44

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