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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,217,428
Messages
6,136,573
Members
450,021
Latest member
Jlopez0320

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