Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code in a Userform that uses VBA controls. The idea is
that the below code should copy the userform data to a worksheet. Unfortunatey the code stops at the line - response = MsgBox("Do you want to enter another record?", In addition no entries are copied to the worksheet, can anyone give me a nudge with this please? Thanks, Mickey Private Sub CmdbuttonSubmit_Click() Dim LastRow As Object Set LastRow = Sheet3.Range("a65536").End(xlUp) LastRow.Offset(1, 0).Value = ComboBoxPIN.Text LastRow.Offset(1, 1).Value = TextBox1.Text LastRow.Offset(1, 2).Value = TextBox2.Text LastRow.Offset(1, 3).Value = TextBox3.Text LastRow.Offset(1, 4).Value = TextBox4.Text LastRow.Offset(1, 5).Value = TextBox5.Text LastRow.Offset(1, 6).Value = TextBox6.Text LastRow.Offset(1, 7).Value = TextBox7.Text LastRow.Offset(1, 8).Value = TextBox8.Text LastRow.Offset(1, 9).Value = ComboBoxArea.Text LastRow.Offset(1, 10).Value = TextBox9.Text LastRow.Offset(1, 11).Value = ComboBoxActivity.Text LastRow.Offset(1, 12).Value = ComboBoxOffence.Text LastRow.Offset(1, 13).Value = TextBox10.Text LastRow.Offset(1, 14).Value = TextBox11.Text LastRow.Offset(1, 16).Value = CheckBoxSDet.Value LastRow.Offset(1, 17).Value = CheckBoxPOMAN.Value LastRow.Offset(1, 18).Value = CheckBoxANPR.Value MsgBox "One record written to Performance Indicator System" response = MsgBox("Do you want to enter another record?", _ vbYesNo) If response = vbYes Then ComboBoxPIN.Text = "" TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" TextBox7.Text = "" TextBox8.Text = "" ComboBoxArea.Text = "" TextBox9.Text = "" ComboBoxActivity.Text = "" ComboBoxOffence.Text = "" TextBox10.Text = "" TextBox11.Text = "" CheckBoxSDet.Value = "" CheckBoxPOMAN.Value = "" CheckBoxANPR.Value = "" ComboBoxPIN.SetFocus Else Unload Me End If End Sub End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Msgbox Code Help Please.... | Excel Discussion (Misc queries) | |||
VBA code using if then and msgbox | Excel Discussion (Misc queries) | |||
msgbox on error | Excel Discussion (Misc queries) | |||
inputbox msgbox error | Excel Programming |