ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Type Mismatch now, not before (https://www.excelbanter.com/excel-programming/339103-type-mismatch-now-not-before.html)

davegb

Type Mismatch now, not before
 
lOutcomesCtyNo = Left(strOutcomes, 2)

I got this line of code in a pervious thread, from Tom Olgivy. Now it
won't run, getting a type mismatch. lOutcomesCtyNo is Dimmed as long,
strOutcomes is dimmed string. So why is it a type mismatch? I'm trying
to get the first 2 characters of strOutcomes, which is a number.
Does anyone know?
Thanks!


Bob Phillips[_6_]

Type Mismatch now, not before
 
Dave,

That code depends upon the first two characters of strOutcomes being
numerice. If not, you'll get a type mismatch.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"davegb" wrote in message
oups.com...
lOutcomesCtyNo = Left(strOutcomes, 2)

I got this line of code in a pervious thread, from Tom Olgivy. Now it
won't run, getting a type mismatch. lOutcomesCtyNo is Dimmed as long,
strOutcomes is dimmed string. So why is it a type mismatch? I'm trying
to get the first 2 characters of strOutcomes, which is a number.
Does anyone know?
Thanks!




davegb

Type Mismatch now, not before
 

Bob Phillips wrote:
Dave,

That code depends upon the first two characters of strOutcomes being
numerice. If not, you'll get a type mismatch.


Found the problem. The code actually works, but it's going further down
the list than I realized and is hitting a condition I hadn't coded for
yet! So it works.
Thanks!

--

HTH

RP
(remove nothere from the email address if mailing direct)


"davegb" wrote in message
oups.com...
lOutcomesCtyNo = Left(strOutcomes, 2)

I got this line of code in a pervious thread, from Tom Olgivy. Now it
won't run, getting a type mismatch. lOutcomesCtyNo is Dimmed as long,
strOutcomes is dimmed string. So why is it a type mismatch? I'm trying
to get the first 2 characters of strOutcomes, which is a number.
Does anyone know?
Thanks!




All times are GMT +1. The time now is 03:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com