Excel VBA Static Timestamp in Worksheet_Change event

后端 未结 2 412
醉梦人生
醉梦人生 2020-12-07 04:11

I am working on creating a log that will automatically populate a timestamp into Cell D, when data is initially entered into Cell C. Unfortunately I have hit a wall.

<
2条回答
  •  臣服心动
    2020-12-07 04:34

    Seems simple enough. Am I missing something? Just check to ensure the cell is blank before you update it.

    With rCell.Offset(0, 1)
        If .Value <> "" Then
            .Value = Now
            .NumberFormat = "hh:mm:ss AM/PM mm/dd/yyyy"
        End If
    End With
    

提交回复
热议问题