Userform to Worksheet value transfer

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Afternoon.
Please could you advise a basic could to transfer values from userform to worksheet.
Some infor for you.

Worksheet called HONDA SHEET
ComboBox1.Value to Cell B21
TextBox1.Value to Cell C21
TextBox2.Value to Cell D21
ComboBox2.Value to Call E21
ComboBox3.value to Cell F21


Here is my attempt but keep getting different RTErrors

Rich (BB code):
Private Sub CommandButton1_Click()
    With ThisWorkbook.Worksheets("HONDA SHEET")
         .Range("B21") = ComboBoxBox1.Value
         .Range("C21") = TextBox1.Value
         .Range("D21") = TextBox2.Value
         .Range("E21") = ComboBox2.Value
         .Range("F21") = ComboBox3.Value
   End With
End Sub
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi ipbr

Try this
VBA Code:
Private Sub CommandButton1_Click()
    With ThisWorkbook.Sheets("HONDA SHEET")
         .Range("B21") = Me.ComboBoxBox1.Value
         .Range("C21") = Me.TextBox1.Value
         .Range("D21") = Me.TextBox2.Value
         .Range("E21") = Me.ComboBox2.Value
         .Range("F21") = Me.ComboBox3.Value
   End With
End Sub
 
Upvote 0
Solution
I believe the problem could be this line:
.Range("B21") = ComboBoxBox1.Value
I think it should be:
.Range("B21") = ComboBox1.Value
I would think you would not have a Combobox named:
ComboBoxBox1
See you have: BoxBox1
 
Upvote 0
You are correct and i did spot that.
Now changed the code works great.

Have a nice day
 
Upvote 0
Yes to yours as i made a type.

& thanks to both of you for the help
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

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