Hi all,
I am currently using the following code transfer data from text boxes on a userform to a spreadsheet in the same workbook.
What I need to happen is for users to all have their own individual copies of the userform which they would have on their desktops, but for the data to be transferred to a spreadsheet that ideally doesn't open or can be manually edited on a shared drive. Essentially, as each data is entered I want it to go to the centrally stored spreadsheet and if requests come in at a similar time, for both entries to still appear even if they are queued somehow rather than overwriting someone elses entry.
This is what I have...any pointers would be appreciated:
I am currently using the following code transfer data from text boxes on a userform to a spreadsheet in the same workbook.
What I need to happen is for users to all have their own individual copies of the userform which they would have on their desktops, but for the data to be transferred to a spreadsheet that ideally doesn't open or can be manually edited on a shared drive. Essentially, as each data is entered I want it to go to the centrally stored spreadsheet and if requests come in at a similar time, for both entries to still appear even if they are queued somehow rather than overwriting someone elses entry.
This is what I have...any pointers would be appreciated:
Code:
Private Sub Userformtotable()
'Copy input values to sheet.
Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet2")
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Cells(lRow, 1).Value = Me.cboFix.Value
.Cells(lRow, 2).Value = Me.Com.Value
.Cells(lRow, 3).Value = Me.Dom.Value
.Cells(lRow, 4).Value = Me.KO.Value
.Cells(lRow, 5).Value = Me.DO.Value
.Cells(lRow, 6).Value = Me.cboCRef.Value
.Cells(lRow, 7).Value = Me.AHolder.Value
.Cells(lRow, 8).Value = Me.AHEmail.Value
.Cells(lRow, 9).Value = Me.Organisation.Value
.Cells(lRow, 10).Value = Me.RBy.Value
.Cells(lRow, 11).Value = Me.RByEmail.Value
.Cells(lRow, 12).Value = Me.CN.Value
.Cells(lRow, 13).Value = Me.CE.Value
.Cells(lRow, 14).Value = Me.User.Value
.Cells(lRow, 15).Value = Me.NowStamp.Value
End With
End Sub