Need help inserting data into certain worksheet from UserForm

curtryan45

New Member
Joined
Jun 6, 2008
Messages
17
I currently have a userform with controls that has a submit button. It submits fine but it always goes into the active sheet (my starting sheet). I need it to go into a worksheet (ChangeData) in the same workbook. Here is the code I currently use

Private Sub btnSubmit_Click()
Worksheets("ChangeData").Range("B2").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = cboPhase.Value
ActiveCell.Offset(0, 1) = cboStep.Value
ActiveCell.Offset(0, 2) = txtTool.Value
ActiveCell.Offset(0, 3) = txtDesc.Value
ActiveCell.Offset(0, 4) = txtName.Value
End Sub

Find the next available row is already taken care of. Thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
it looks like it should work but maybe try replacing ActiveCell with Selection
 
Upvote 0
I figured it out, for some reason it worked when I changed Worksheets to Sheets separated Sheets.Select and Range.Select
 
Upvote 0

Forum statistics

Threads
1,214,797
Messages
6,121,629
Members
449,041
Latest member
Postman24

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