Userform (designate what cells info goes to instead of next blank row)

MWhiteDesigns

Well-known Member
Joined
Nov 17, 2010
Messages
646
Office Version
  1. 2016
Platform
  1. 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
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,224,590
Messages
6,179,753
Members
452,940
Latest member
rootytrip

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