monkeychuff
Board Regular
- Joined
- Oct 17, 2009
- Messages
- 67
Hi,
I have a simple userform which saves the data that is entered to a sheet within the same file, but there are now a couple of these files and I need all of this information to be saved to one (location) external spreadsheet. How can I ammend the code below to achieve this?
I have a simple userform which saves the data that is entered to a sheet within the same file, but there are now a couple of these files and I need all of this information to be saved to one (location) external spreadsheet. How can I ammend the code below to achieve this?
Code:
Private Sub CloseSaveButton_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("PartsData")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.DateTextBox.Value
ws.Cells(iRow, 2).Value = Me.RaisedByTextBox.Value
ws.Cells(iRow, 3).Value = Me.LineNumberTextBox.Value
ws.Cells(iRow, 4).Value = Me.ProductCodeComboBox.Value
ws.Cells(iRow, 5).Value = Me.EquipmentComboBox.Value
ws.Cells(iRow, 6).Value = Me.IssueTextBox.Value
ws.Cells(iRow, 7).Value = Me.CauseTextBox.Value
ws.Cells(iRow, 8).Value = Me.CorrectiveActionTextBox.Value
Unload Me
End Sub