userform

cmccabe

Active Member
Joined
Feb 20, 2008
Messages
396
I am trying to use a userform to enter data and can not seem to have the next data entry appear on a new line. It is a simple userform that has about 10 fields that are inputted and then the user clicks a button that transfers the data and allows for another entry. However, i do not seem to be doing that correctly. Thanks.
Code:
Private Sub cmdTransfer_Click()
Dim RowCount As Long
'Range("A2") = txtCase.Value
'Range("B2") = txtEnd.Value
'Range("C2") = txtReview.Value
'Range("D2") = cboDx.Text
'Range("E2") = txtAge.Value
'Range("F2") = cboAge.Text
'Range("G2") = cboGender.Text
'Range("H2") = cboStatus.Text
'Range("I2") = cbLSAB.Text
'Range("J2") = cbSSPHR.Text
'Range("K2") = cbSSPLR.Text
'Range("L2") = cbSBT.Text
'Range("M2") = cboDonor.Text
'Range("N2") = txtType.Text
'Range("O2") = txtKey.Text
RowCount = Worksheets("HSCBM_RD").Range("A2").CurrentRegion.Rows.Count
With Worksheets("HSCBM_RD").Range("A2")
    .Offset(RowCount, 0) = Me.txtCase.Value
    .Offset(RowCount, 1) = Me.txtEnd.Value
    .Offset(RowCount, 2) = Me.txtReview.Value
    .Offset(RowCount, 3) = Me.cboDx.Value
    .Offset(RowCount, 4) = Me.txtAge.Value
    .Offset(RowCount, 5) = Me.cboAge.Value
    .Offset(RowCount, 6) = Me.cboGender.Value
    .Offset(RowCount, 7) = Me.cboStatus.Value
    .Offset(RowCount, 8) = Me.cbLSAB.Value
    .Offset(RowCount, 9) = Me.cbSSPHR.Value
    .Offset(RowCount, 10) = Me.cbSSPLR.Value
    .Offset(RowCount, 11) = Me.cbSBT.Value
    .Offset(RowCount, 12) = Me.cboDonor.Value
    .Offset(RowCount, 13) = Me.txtType.Value
    .Offset(RowCount, 14) = Me.txtKey.Value
End With
End Sub
 
Do you mean that you have the lists/values for the comboboxes on the same worksheet where the data is meant to go?
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
After an entry 1 is made in the uderform and transfferd back to the spreadsheet, in order to make a new entry 2, the fields in the userform have to be cleared. Is there a way that can be done automatically when the transfer button is clicked? Thanks.
 
Upvote 0
You can unload and then show the form.
Code:
Unload Me
 
UserForm1.Show
 
Upvote 0
That worked great, thank you. The last question that I have is there a way to get a popup calander on a specific textbox. Once the date is selected it appears in the textbox?

I have a txtDate box that I would like a popup calander to be displayed when the user clicks in the textbox. The date is selected and will then appear in the txtDate box. Thanks.
 
Upvote 0
You should probably start a new thread for that.

PS What you want is a Calendar Control or DT (Date/Time) Picker control.

Probably the latter - I've sen quite a few people have problems with the Calendar.
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,733
Members
452,939
Latest member
WCrawford

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