Textbox2.Value (Type mismatch)

AndrewMB

Board Regular
Joined
Feb 3, 2008
Messages
75
Any ideas as to why this error occurs?



Private Sub CommandButton1_Click()

If ComboBox1.Value = "Plate" Then
Range("Date_Drop") = ComboBox2.Value
Range("Var_Drop") = ComboBox3.Value

If ComboBox3.Value = 2 Then
Range("V_Drop_One") = "=VLOOKUP(Date_Drop,C7:BN5000,2)"
TextBox2.Value = Range("V_Drop_One") - This line errors out. (Could not set the value property. Type mismatch.)


 
Correct, 2,3,4,5,6,8,10,12,15,20,25,30,35,40 & 60 are repeated.

Rows D:R, T:AH, AJ:AX, and AZ:BN.
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Andrew

So how is Combobox3 populated?

Is it populated with just one set of those values?
 
Upvote 0
Yes, because the thickness set applies across each category, stock, orders, plate in and plate out.
 
Upvote 0
Well that's exactly what I assumed.

Have you tried the code I posted?
 
Upvote 0
Norie,

Just pasted it in and ran it. Works perfectly...

This is a perfect example for me, of where I want to be with regards to using VBA more efficiently.

I'm self taught and fairly new to it, the fact that I can get it to do things off my own back still amazes me. But when it comes to using VBA like it should be used, well I'm a mile off!

But I'll get there.

Listen Norie, thank you. I know you've spent some personal time on this one, and I appreciate it.


Many thanks.

:beerchug:
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,827
Members
452,946
Latest member
JoseDavid

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