Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a userform where
Problems =name of Listbox on the same form as the Checkbox(SFCC_Bite) Private Sub SFCC_Bite_Click() If SFCC_Bite.Enabled = True Then With Problems .AddItem Worksheets("Sheet1").Range("A3:A20").Value End With Problems.Enabled = True End If End Sub as the range on Sheet1 is a list of names why does this line give a type mismatch error .AddItem Worksheets("Sheet1").Range("A3:A20").Value Forgive me I'm reasonably new to VBA. Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are trying to add more than one item. If you want to do that, use
With Problems .List Worksheets("Sheet1").Range("A3:A20").Value End With -- Regards, Tom Ogilvy "Aonghus" wrote in message ... I have a userform where Problems =name of Listbox on the same form as the Checkbox(SFCC_Bite) Private Sub SFCC_Bite_Click() If SFCC_Bite.Enabled = True Then With Problems .AddItem Worksheets("Sheet1").Range("A3:A20").Value End With Problems.Enabled = True End If End Sub as the range on Sheet1 is a list of names why does this line give a type mismatch error .AddItem Worksheets("Sheet1").Range("A3:A20").Value Forgive me I'm reasonably new to VBA. Thanks in advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom
But now it gives me an Invalid use of property "Tom Ogilvy" wrote: You are trying to add more than one item. If you want to do that, use With Problems .List Worksheets("Sheet1").Range("A3:A20").Value End With -- Regards, Tom Ogilvy "Aonghus" wrote in message ... I have a userform where Problems =name of Listbox on the same form as the Checkbox(SFCC_Bite) Private Sub SFCC_Bite_Click() If SFCC_Bite.Enabled = True Then With Problems .AddItem Worksheets("Sheet1").Range("A3:A20").Value End With Problems.Enabled = True End If End Sub as the range on Sheet1 is a list of names why does this line give a type mismatch error .AddItem Worksheets("Sheet1").Range("A3:A20").Value Forgive me I'm reasonably new to VBA. Thanks in advance |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, left out the Equal sign:
With Problems .List = Worksheets("Sheet1").Range("A3:A20").Value End With -- Regards, Tom Ogilvy "Aonghus" wrote in message ... Thanks Tom But now it gives me an Invalid use of property "Tom Ogilvy" wrote: You are trying to add more than one item. If you want to do that, use With Problems .List Worksheets("Sheet1").Range("A3:A20").Value End With -- Regards, Tom Ogilvy "Aonghus" wrote in message ... I have a userform where Problems =name of Listbox on the same form as the Checkbox(SFCC_Bite) Private Sub SFCC_Bite_Click() If SFCC_Bite.Enabled = True Then With Problems .AddItem Worksheets("Sheet1").Range("A3:A20").Value End With Problems.Enabled = True End If End Sub as the range on Sheet1 is a list of names why does this line give a type mismatch error .AddItem Worksheets("Sheet1").Range("A3:A20").Value Forgive me I'm reasonably new to VBA. Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
Type Mismatch | Excel Programming | |||
Type mismatch? | Excel Programming | |||
Type mismatch | Excel Programming | |||
Type Mismatch | Excel Programming |