Userforms to populate cells

Waterpolo1

New Member
Joined
Sep 8, 2015
Messages
21
I have a user form with 3 questions.

1.) Thickness (this selects the correct sheet I have e.g "6-8mm", "10-12mm").
2.) Number of defects. From question 1, this number here is inputed into the correct work sheet.
3.) Number of people. Same as questions 2; this number here is inputed into the relevant cell on the worksheet selected in question 1.

I have the following code but it doesn't appear to work:-

Private Sub Submitbutton_Click()
Sheets("ListBox1.Value").Range("B20").Value = Me.tbdefect.Value


End Sub
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Sheets("ListBox1.Value") should be Sheets(ListBox1.Value)
The way it's currently entered, excel is looking for a sheet named "ListBox1.Value" and isn't finding it.
 
Upvote 0

Forum statistics

Threads
1,226,695
Messages
6,192,475
Members
453,726
Latest member
JoeH57

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