Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
type mismatch error
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, -- Valeria |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
type mismatch error
Hi
Change "Cells" to "Range" and your problem should be solved If this helps please click "Yes" <<<<<<<<<< "Valeria" wrote: 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, -- Valeria |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
type mismatch error
it works beautifully, many thanks!
-- Valeria "BSc Chem Eng Rick" wrote: Hi Change "Cells" to "Range" and your problem should be solved If this helps please click "Yes" <<<<<<<<<< "Valeria" wrote: 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, -- Valeria |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
type mismatch error
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 "Valeria" wrote: 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, -- Valeria |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
runtime error 13 - type mismatch error in Excel 97 on Citrix | Excel Programming | |||
Conditional Formatting - Run Time Error '13' Type Mismatch Error | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error | Excel Programming |