MWhiteDesigns
Well-known Member
- Joined
- Nov 17, 2010
- Messages
- 646
- Office Version
- 2016
- Platform
- Windows
Hey Guys,
I currently have a userform that inputs data from the form into a sheet on the next available row.
I am trying to create a new userform where each text box or combo box etc. transposes data to a specific cell on the spreadsheet( one time use type of thing.)
This is what I am using below. I have a feeling the irow needs to be changed to something else but i can't figure it out.
Private Sub SubmitCommand_Click()
Dim irow As Long
Dim ws As Worksheet
Set ws = Sheets("HVS Attrition")
irow = ws.Cells(Rows.Count, 4).End(xlUp).Offset(1, 0).Row
With ws
.Range("C4" & irow) = NameTextBox.Value
.Range("C8" & irow) = EIDTextBox.Value
.Range("C12" & irow) = AVAYATextBox.Value
.Range("C16" & irow) = DepartmentComboBox.Value
.Range("C18" & irow) = EffectiveDateTextBox.Value
.Range("C20" & irow) = ReasonComboBox.Value
.Range("C23" & irow) = ReportedByTextBox.Value
If Me.YesOptionButton.Value = True Then
.Range("C26" & irow) = "Yes"
End If
If Me.NoOptionButton.Value = True Then
.Range("C26" & irow) = "No"
End If
If Me.SundayCheckBox.Value = True Then
.Range("G4" & irow) = "X"
End If
If Me.MondayCheckBox.Value = True Then
.Range("G6" & irow) = "X"
End If
If Me.TuesdayCheckBox.Value = True Then
.Range("G8" & irow) = "X"
End If
If Me.WednesdayCheckBox.Value = True Then
.Range("G10" & irow) = "X"
End If
If Me.ThursdayCheckBox.Value = True Then
.Range("G12" & irow) = "X"
End If
If Me.FridayCheckBox.Value = True Then
.Range("G14" & irow) = "X"
End If
If Me.SaturdayCheckBox.Value = True Then
.Range("G16" & irow) = "X"
End If
End With
End Sub
I currently have a userform that inputs data from the form into a sheet on the next available row.
I am trying to create a new userform where each text box or combo box etc. transposes data to a specific cell on the spreadsheet( one time use type of thing.)
This is what I am using below. I have a feeling the irow needs to be changed to something else but i can't figure it out.
Private Sub SubmitCommand_Click()
Dim irow As Long
Dim ws As Worksheet
Set ws = Sheets("HVS Attrition")
irow = ws.Cells(Rows.Count, 4).End(xlUp).Offset(1, 0).Row
With ws
.Range("C4" & irow) = NameTextBox.Value
.Range("C8" & irow) = EIDTextBox.Value
.Range("C12" & irow) = AVAYATextBox.Value
.Range("C16" & irow) = DepartmentComboBox.Value
.Range("C18" & irow) = EffectiveDateTextBox.Value
.Range("C20" & irow) = ReasonComboBox.Value
.Range("C23" & irow) = ReportedByTextBox.Value
If Me.YesOptionButton.Value = True Then
.Range("C26" & irow) = "Yes"
End If
If Me.NoOptionButton.Value = True Then
.Range("C26" & irow) = "No"
End If
If Me.SundayCheckBox.Value = True Then
.Range("G4" & irow) = "X"
End If
If Me.MondayCheckBox.Value = True Then
.Range("G6" & irow) = "X"
End If
If Me.TuesdayCheckBox.Value = True Then
.Range("G8" & irow) = "X"
End If
If Me.WednesdayCheckBox.Value = True Then
.Range("G10" & irow) = "X"
End If
If Me.ThursdayCheckBox.Value = True Then
.Range("G12" & irow) = "X"
End If
If Me.FridayCheckBox.Value = True Then
.Range("G14" & irow) = "X"
End If
If Me.SaturdayCheckBox.Value = True Then
.Range("G16" & irow) = "X"
End If
End With
End Sub