View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default unknown type mismatch

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