From: GTyson2 on
Hi All,

I get the type mismatch error on this line of code

TmpCB.Sheets("03-10").Cells(z, 2).Value =
OldCB.Sheets("032010").Cells(x, 2).Value + " - " +
OldCB.Sheets("032010").Cells(x, 3).Value


I know that cells(x,2) at this poin in the code is "check run" and
Cells(x,3) is "4277"
I'm sure it's because "check run" is text and "4277" is a number, but I
can't figure a way around it. I've tried doing .text instead of .value but it
still didn't work.

Can someone help me fix this?
From: Jim Cone on


Use "&" instead of "+" 'no quote marks
--
Jim Cone
Portland, Oregon USA




"GTyson2" <GTyson2(a)discussions.microsoft.com>
wrote in message news:652346AE-F963-45FA-A92C-45C7165C985C(a)microsoft.com...
Hi All,

I get the type mismatch error on this line of code

TmpCB.Sheets("03-10").Cells(z, 2).Value =
OldCB.Sheets("032010").Cells(x, 2).Value + " - " +
OldCB.Sheets("032010").Cells(x, 3).Value


I know that cells(x,2) at this poin in the code is "check run" and
Cells(x,3) is "4277"
I'm sure it's because "check run" is text and "4277" is a number, but I
can't figure a way around it. I've tried doing .text instead of .value but it
still didn't work.

Can someone help me fix this?
From: Dave Peterson on
It looks like you're trying to build a string.

Try using &'s instead of +'s.

TmpCB.Sheets("03-10").Cells(z, 2).Value _
= OldCB.Sheets("032010").Cells(x, 2).Value & " - " & _
OldCB.Sheets("032010").Cells(x, 3).Value

GTyson2 wrote:
>
> Hi All,
>
> I get the type mismatch error on this line of code
>
> TmpCB.Sheets("03-10").Cells(z, 2).Value =
> OldCB.Sheets("032010").Cells(x, 2).Value + " - " +
> OldCB.Sheets("032010").Cells(x, 3).Value
>
> I know that cells(x,2) at this poin in the code is "check run" and
> Cells(x,3) is "4277"
> I'm sure it's because "check run" is text and "4277" is a number, but I
> can't figure a way around it. I've tried doing .text instead of .value but it
> still didn't work.
>
> Can someone help me fix this?

--

Dave Peterson
From: Barb Reinhardt on
Have you tried replacing + with & ?
--
HTH,

Barb Reinhardt



"GTyson2" wrote:

> Hi All,
>
> I get the type mismatch error on this line of code
>
> TmpCB.Sheets("03-10").Cells(z, 2).Value =
> OldCB.Sheets("032010").Cells(x, 2).Value + " - " +
> OldCB.Sheets("032010").Cells(x, 3).Value
>
>
> I know that cells(x,2) at this poin in the code is "check run" and
> Cells(x,3) is "4277"
> I'm sure it's because "check run" is text and "4277" is a number, but I
> can't figure a way around it. I've tried doing .text instead of .value but it
> still didn't work.
>
> Can someone help me fix this?