Garden_Lily
New Member
- Joined
- Nov 27, 2017
- Messages
- 1
Here is the code I have, but it is not working.
Private Sub CommandButton1_Click()
Dim emptyRow As Long
'Activate Data Request Worksheet
Sheets("Request Data").Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Sheets("Data Request").Cells(emptyRow, 1).Value = ComboBox1.Value
Sheets("Data Request").Cells(emptyRow, 2).Value = TextBox4.Value
Sheets("Data Request").Cells(emptyRow, 3).Value = TextBox1.Value
Sheets("Data Request").Cells(emptyRow, 4).Value = TextBox2.Value
Sheets("Data Request").Cells(emptyRow, 5).Value = OptionButton3.Value
Sheets("Data Request").Cells(emptyRow, 6).Value = OptionButton4.Value
Sheets("Data Request").Cells(emptyRow, 7).Value = OptionButton5.Value
Sheets("Data Request").Cells(emptyRow, 8).Value = OptionButton6.Value
Sheets("Data Request").Cells(emptyRow, 9).Value = OptionButton1.Value
Sheets("Data Request").Cells(emptyRow, 10).Value = OptionButton2.Value
Sheets("Data Request").Cells(emptyRow, 11).Value = TextBox3.Value
Sheets("Data Request").Cells(emptyRow, 12).Value = OptionButton2.Value
Sheets("Data Request").Cells(emptyRow, 13).Value = OptionButton2.Value
Sheets("Data Request").Cells(emptyRow, 14).Value = OptionButton2.Value
Sheets("Data Request").Cells(emptyRow, 15).Value = OptionButton2.Value
If CheckBox3.Value = True Then
Sheets("Data Request").Cells(emptyRow, 16).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 16).Value = "No"
End If
If CheckBox1.Value = True Then
Sheets("Data Request").Cells(emptyRow, 17).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 17).Value = "No"
End If
If CheckBox2.Value = True Then
Sheets("Data Request").Cells(emptyRow, 18).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 18).Value = "No"
End If
If CheckBox4.Value = True Then
Sheets("Data Request").Cells(emptyRow, 19).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 19).Value = "No"
End If
If CheckBox5.Value = True Then
Sheets("Data Request").Cells(emptyRow, 20).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 20).Value = "No"
End If
If CheckBox6.Value = True Then
Sheets("Data Request").Cells(emptyRow, 21).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 21).Value = "No"
End If
If CheckBox7.Value = True Then
Sheets("Data Request").Cells(emptyRow, 22).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 22).Value = "No"
End If
End Sub
Private Sub CommandButton1_Click()
Dim emptyRow As Long
'Activate Data Request Worksheet
Sheets("Request Data").Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Sheets("Data Request").Cells(emptyRow, 1).Value = ComboBox1.Value
Sheets("Data Request").Cells(emptyRow, 2).Value = TextBox4.Value
Sheets("Data Request").Cells(emptyRow, 3).Value = TextBox1.Value
Sheets("Data Request").Cells(emptyRow, 4).Value = TextBox2.Value
Sheets("Data Request").Cells(emptyRow, 5).Value = OptionButton3.Value
Sheets("Data Request").Cells(emptyRow, 6).Value = OptionButton4.Value
Sheets("Data Request").Cells(emptyRow, 7).Value = OptionButton5.Value
Sheets("Data Request").Cells(emptyRow, 8).Value = OptionButton6.Value
Sheets("Data Request").Cells(emptyRow, 9).Value = OptionButton1.Value
Sheets("Data Request").Cells(emptyRow, 10).Value = OptionButton2.Value
Sheets("Data Request").Cells(emptyRow, 11).Value = TextBox3.Value
Sheets("Data Request").Cells(emptyRow, 12).Value = OptionButton2.Value
Sheets("Data Request").Cells(emptyRow, 13).Value = OptionButton2.Value
Sheets("Data Request").Cells(emptyRow, 14).Value = OptionButton2.Value
Sheets("Data Request").Cells(emptyRow, 15).Value = OptionButton2.Value
If CheckBox3.Value = True Then
Sheets("Data Request").Cells(emptyRow, 16).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 16).Value = "No"
End If
If CheckBox1.Value = True Then
Sheets("Data Request").Cells(emptyRow, 17).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 17).Value = "No"
End If
If CheckBox2.Value = True Then
Sheets("Data Request").Cells(emptyRow, 18).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 18).Value = "No"
End If
If CheckBox4.Value = True Then
Sheets("Data Request").Cells(emptyRow, 19).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 19).Value = "No"
End If
If CheckBox5.Value = True Then
Sheets("Data Request").Cells(emptyRow, 20).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 20).Value = "No"
End If
If CheckBox6.Value = True Then
Sheets("Data Request").Cells(emptyRow, 21).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 21).Value = "No"
End If
If CheckBox7.Value = True Then
Sheets("Data Request").Cells(emptyRow, 22).Value = "Yes"
Else
Sheets("Data Request").Cells(emptyRow, 22).Value = "No"
End If
End Sub