type mismatch error

V

Valeria

Dear experts,
I am getting a type mismatch error with my sub
Private Sub OK_Btn_Click()
Dim Country_Name As String
Country_Name = Me.ComboBox1.Value
Worksheets("Choix").Cells("c15").value = Country_Name
Unload Me
End Sub

I guess it's because Country_Name is a string, and
Worksheets("Choix").Cells("c15").value is read as integer.
How can I set this up so that it works?

Many thanks in advance for your help,
Kind regards,
 
B

BSc Chem Eng Rick

Hi

Change "Cells" to "Range" and your problem should be solved

If this helps please click "Yes"
<><><><><><><><><><>
 
V

Valeria

it works beautifully, many thanks!
--
Valeria


BSc Chem Eng Rick said:
Hi

Change "Cells" to "Range" and your problem should be solved

If this helps please click "Yes"
<><><><><><><><><><>
 
M

Mike H

Hi,

Change this

Worksheets("Choix").Cells("c15").value = Country_Name

to this
Worksheets("Choix").Range("c15").value = Country_Name
or this
Worksheets("Choix").Cells(14, 3).Value = Country_Name

Mike


Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top