MikeOM_DBA
asked on
Concatenate in vba give "type mismatch" error
HI Guys,
Adding some VBA code to my spreadsheet, but cannot seem to make it work:
I'm trying to concatenate two cells like this:
I'm sure you experts have the solution to this somewhat basic question.
Thanks.
Adding some VBA code to my spreadsheet, but cannot seem to make it work:
I'm trying to concatenate two cells like this:
Dim eSpk(20), eAss(20), eLsn(20), eEvl(20) As String
. . .
eSpk(i) = e0.Offset(0, 1).Value
eAss(i) = e0.Offset(0, 2).Value
eLsn(i) = "#" & e0.Offset(0, 3).Value & " " & e0.Offset(0, 4).Value
eEvl(i) = e0.Offset(0, 5).Value
. . .
And gives "Type" mismatch.I'm sure you experts have the solution to this somewhat basic question.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Found it...
Put the procedure in separate module and call it from main module worked!
Spent almost 2 days debugging.
Thanks anyway for looking into it.
Put the procedure in separate module and call it from main module worked!
Spent almost 2 days debugging.
Thanks anyway for looking into it.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for MikeOM_DBA's comment #a40467638
Assisted answer: 100 points for imnorie's comment #a40467602
for the following reason:
Did not find the cause, but now it works...
Accepted answer: 0 points for MikeOM_DBA's comment #a40467638
Assisted answer: 100 points for imnorie's comment #a40467602
for the following reason:
Did not find the cause, but now it works...
Glad you got it working.:)
What happens if you change the code to use an explicit sheet reference like this.
What happens if you change the code to use an explicit sheet reference like this.
For Each e0 In Sheets("EmailMM").Range("MMemail").Cells
ASKER
PS: The cause was the relocation of a named range which had absolute ($xx) addressing which then invalidated dependent locations.
Thanks for the tip.
Thanks for the tip.
ASKER
If I put the "sub" in it's own module, it works when executed by itself
But if I call from another module it breaks.
here is some more code:
Open in new window