Hi Excel Forum,
I have just recently started learning about vba and macros.
Currently, I am creating a macro to auto-input a date & time stamp(on a2) once another value has been placed on another cell(b2), with the help of a video from Youtube I am able to make the idea partly work.
I am encountering an error: "runtime error 1004 numberformat of range"
here is my macro(on "worksheet" & "change" dropdown):
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
For i = 2 To 102
If Cells(i, "B").Value <> "" Then
Cells(i, "A").Value = Date & " " & Time
Cells(i, "A").NumberFormat "m/d/yyyy h:mm"
End If
Next
Range("A:A").EntireColumn.AutoFit
End Sub
Any corrections & suggestions to make my sheet work will be great!
#Edit:
By the way the sheet is unlocked.
Bookmarks