Save userform data to external spreadsheet

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?

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
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,224,598
Messages
6,179,822
Members
452,946
Latest member
JoseDavid

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