How to automatically extend formulas on data entered via a UserForm

shirleyj

New Member
Joined
Sep 14, 2011
Messages
37
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
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,224,552
Messages
6,179,488
Members
452,917
Latest member
MrsMSalt

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