Hi Mr Excel,
I have set up a basic user form to input information on a database. However, I have run into two issues:
1. I would like formulas to be automatically extended to the row of data just added from the row above
2. I would also like to include a date/time stamp when the record was added to the database. I have always used the below ‘change’ procedure to add the timestamp, which works perfectly when the data is directly inputted on the spreadsheet. However, this does not work when the data is input via a userform.
I am guessing that the code for the userform command button needs to be tweaked slightly to include instructions for this action, but I am not sure how to do this?
Any help, as always, is much appreciated!
Best regards,
Shirley
Private Sub Worksheet_Change(ByVal areaOfInterest As Range)
If areaOfInterest.Column = 2 Then
If areaOfInterest.Row > 2 Then
areaOfInterest.Offset(0, 11) = Now
areaOfInterest.Offset(0, 11).NumberFormat = "dd MMMM yyyy"
End If
End If
End Sub
I have set up a basic user form to input information on a database. However, I have run into two issues:
1. I would like formulas to be automatically extended to the row of data just added from the row above
2. I would also like to include a date/time stamp when the record was added to the database. I have always used the below ‘change’ procedure to add the timestamp, which works perfectly when the data is directly inputted on the spreadsheet. However, this does not work when the data is input via a userform.
I am guessing that the code for the userform command button needs to be tweaked slightly to include instructions for this action, but I am not sure how to do this?
Any help, as always, is much appreciated!
Best regards,
Shirley
Private Sub Worksheet_Change(ByVal areaOfInterest As Range)
If areaOfInterest.Column = 2 Then
If areaOfInterest.Row > 2 Then
areaOfInterest.Offset(0, 11) = Now
areaOfInterest.Offset(0, 11).NumberFormat = "dd MMMM yyyy"
End If
End If
End Sub