combo box dependant userform submit button

chroniclesofdave

New Member
Joined
Aug 8, 2016
Messages
48
I have this code:
Code:
Private Sub sbmt_Click()
Dim irow As Long
Dim wb As Workbook
Dim ws As Worksheet
If NHdata.nhNme.Value = "JOHN" Then
Set wb = Workbooks.Open("L:\NAMES\JOHN\JOHN.xlsm")
Set ws = Worksheets("Data")
ElseIf NHdata.nhnNme.Value = "GRANT" Then
Set wb = Workbooks.Open("L:\NAMES\Grant\Grant.xlsm")
Set ws = Worksheets("Data")
End If

im getting an error "13 type mismatch" is there any solution to this issue?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,215,757
Messages
6,126,695
Members
449,331
Latest member
smckenzie2016

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