
Untitled
By: a guest on
Apr 23rd, 2012 | syntax:
None | size: 0.95 KB | hits: 10 | expires: Never
Excel User Form that submits to a network workbook
Private Sub CommandButton1_Click()
On Error GoTo 1
Dim nwb As Workbook
Set nwb = Workbooks.Open("N:GeneralFORMSNew_FORM.xls")
Set ws = Worksheets("FORM Data")
iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
ws.Cells(iRow, 1).Value = Me.TextBox1.Value
ws.Cells(iRow, 2).Value = Me.TextBox2.Value
ws.Cells(iRow, 3).Value = Me.ComboBox1.Value
ws.Cells(iRow, 4).Value = Me.ComboBox2.Value
ws.Cells(iRow, 5).Value = Me.ComboBox6.Value
ws.Cells(iRow, 6).Value = Me.TextBox3.Value
ws.Cells(iRow, 7).Value = Me.TextBox4.Value
ws.Cells(iRow, 8).Value = Me.ComboBox4.Value
ws.Cells(iRow, 9).Value = Me.ComboBox5.Value
ws.Cells(iRow, 10).Value = Me.TextBox5.Value
'With nwb.Sheets(1)
'.Range("A1").Value = Me.TextBox1.Value
'.Range("B1").Value = Me.TextBox2.Value
'.Range("C1").Value = Me.ComboBox1.Value
'End With
nwb.Close True
End Sub