Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 414
Default Left vs Left$ function

Can someone explain the difference between the two of these? Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 182
Default Left vs Left$ function

Andy wrote on Sat, 5 May 2007 05:25:00 -0700:

A Can someone explain the difference between the two of these?
A Thanks!

I don't seem to have LEFT$ in Excel 2002. When did it appear or
disappear? There *is* LEFTB that refers to double byte
characters like Chinese ones.

James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.comcast.not

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default Left vs Left$ function

I don't recall Excel having a LEFT$() worksheet function, BUT it is used in
VBA.

Here's the differece (as I understand it)

LEFT(string, num_chars) returns a VARIANT.

But, in LEFT$(string, num_chars), the trailing dollar sign ($) declares the
return value to be a STRING.

It would make a difference if the 1st argument could be null.

Example:
In the immediate window of the VB Editor....

If you enter DEBUG.PRINT LEFT(NULL,3)
This is returned: NULL

But, if you enter DEBUG.PRINT LEFT$(NULL,3)
you get this error: "Invalid use of null",
because a STRING cannot be null.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Andy" wrote:

Can someone explain the difference between the two of these? Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default Left vs Left$ function

And the reason you'd use one or the other is that Left$ may be quicker if
all you're doing is manipulating strings, while Left would help if you're
going to encounter the situation Ron describes.

There are also such functions as Right$ and Mid$.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ron Coderre" wrote in message
...
I don't recall Excel having a LEFT$() worksheet function, BUT it is used in
VBA.

Here's the differece (as I understand it)

LEFT(string, num_chars) returns a VARIANT.

But, in LEFT$(string, num_chars), the trailing dollar sign ($) declares
the
return value to be a STRING.

It would make a difference if the 1st argument could be null.

Example:
In the immediate window of the VB Editor....

If you enter DEBUG.PRINT LEFT(NULL,3)
This is returned: NULL

But, if you enter DEBUG.PRINT LEFT$(NULL,3)
you get this error: "Invalid use of null",
because a STRING cannot be null.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Andy" wrote:

Can someone explain the difference between the two of these? Thanks!



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Left vs Left$ function

Left$ and Right$ and Mid$ and other string operators are "left over" from the
days of BASIC. Ron and Jon have explained their use quite well. LEFT, RIGHT
etc are late comers to the world.

As you note, James, there is no LEFT$, RIGHT$, MID$ for the worksheet
itself, just in the innards of VB.

"James Silverton" wrote:

Andy wrote on Sat, 5 May 2007 05:25:00 -0700:

A Can someone explain the difference between the two of these?
A Thanks!

I don't seem to have LEFT$ in Excel 2002. When did it appear or
disappear? There *is* LEFTB that refers to double byte
characters like Chinese ones.

James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.comcast.not




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 182
Default Left vs Left$ function

JLatham wrote on Sat, 5 May 2007 18:31:00 -0700:

Left$ and Right$ and Mid$ and other string operators are "left
over" from the
days of BASIC. Ron and Jon have explained their use quite
well. LEFT, RIGHT
etc are late comers to the world.


J As you note, James, there is no LEFT$, RIGHT$, MID$ for the
J worksheet itself, just in the innards of VB.

Ah, you've jogged my memory; it was BASIC! I had a feeling that
I had seen things like LEFT$ in computer languages of the dim
past :-) I knew it wasn't Fortran, FOCAL, Algol or C but I had
not thought of BASIC!!

James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.comcast.not

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
MID function from right to left nsv Excel Worksheet Functions 4 May 8th 23 11:41 AM
left function ah Excel Worksheet Functions 4 January 31st 07 01:24 PM
Column labels run right to left, not left to right tmassey Excel Discussion (Misc queries) 1 November 10th 06 12:03 PM
Left function Allan Excel Discussion (Misc queries) 4 December 3rd 05 04:13 PM
How to change the right-to-left worksheet to left-to-right workshe RAMA Excel Discussion (Misc queries) 1 July 4th 05 01:57 PM


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

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

About Us

"It's about Microsoft Excel"