View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default What is wrong with this For Each statement?

I don't think I've seen an Error 13 before. Does this help?
http://support.microsoft.com/kb/821292

That IIF looks like something from Access-world.
Maybe this will help:
http://www.access-programmers.co.uk/...ad.php?t=88805

Good luck,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Ryan M-J" wrote:

it throws "Type Mismatch (13)" on the "for each" line only if the range is
strings, numbers work fine, but I need it to be strings

Dim addresses As String

For Each c In IIf(Range("C3").End(xlDown), Range("C3",
Range("C3").End(xlDown)), Range("C3"))
If addresses < "" Then
addresses = addresses & ", " & c.Value
Else
addresses = c.Value
End If
Next