#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 'Right'

Hi,

I have the following code and it seems to work on excel 97. On excel 2000 it
doesn't work, it gets 'stuck' at 'right'. Is there a different form of code
that will work for both?

MyVal = Right(Result1, 3)

Thanks Michael


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default 'Right'

Himszy

VBA's Right Function has not changed at all. I suspect that the coercion to
the type of the myVal variable may be the problem.

It would help if you gave us the error.

If it is a matter of coercion then perhaps try

CDbl(), CSng(), CInt(), etc

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS

"Himszy" wrote in message
k...
Hi,

I have the following code and it seems to work on excel 97. On excel 2000
it
doesn't work, it gets 'stuck' at 'right'. Is there a different form of
code
that will work for both?

MyVal = Right(Result1, 3)

Thanks Michael




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 'Right'

'Can't find project or library'
"Nick Hodge" wrote in message
...
Himszy

VBA's Right Function has not changed at all. I suspect that the coercion

to
the type of the myVal variable may be the problem.

It would help if you gave us the error.

If it is a matter of coercion then perhaps try

CDbl(), CSng(), CInt(), etc

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS

"Himszy" wrote in message
k...
Hi,

I have the following code and it seems to work on excel 97. On excel

2000
it
doesn't work, it gets 'stuck' at 'right'. Is there a different form of
code
that will work for both?

MyVal = Right(Result1, 3)

Thanks Michael






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 'Right'

Nick is part right. After the error, go into the VBE, then go into
Tools=References (you might have to hit the reset button). Your project
must be the active project. In the reference listing, there should be at
least one reference marked as MISSING. If you are not using this reference,
then go back to your source workbook and remove it. then copy it back to
this machine and try again. If you are using it, then you need to get a copy
of the library installed and registered on this machine.

By the way, Right has nothing to do with the cause of the actual error.

--
Regards,
Tom Ogilvy


"Himszy" wrote in message
k...
'Can't find project or library'
"Nick Hodge" wrote in message
...
Himszy

VBA's Right Function has not changed at all. I suspect that the coercion

to
the type of the myVal variable may be the problem.

It would help if you gave us the error.

If it is a matter of coercion then perhaps try

CDbl(), CSng(), CInt(), etc

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS

"Himszy" wrote in message
k...
Hi,

I have the following code and it seems to work on excel 97. On excel

2000
it
doesn't work, it gets 'stuck' at 'right'. Is there a different form of
code
that will work for both?

MyVal = Right(Result1, 3)

Thanks Michael










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"