Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Equivalent Of VAL


In VBA two cells containing alphanumeric strings like "123abc" can b
subjected to evaluation via the use of VAL. Thus, with "97asd" in A
and "54jkm" in A2,
Val(Range("a1"))-Val(Range("a2")) yields 43 ~ (97 minus 23).

Is there a Worksheetfunction that perfoms such role? Both the N an
VALUE
Worksheetfunctions failed me in this regard.

=N(A1)-N(A2) -- 0 while VALUE(A1)-VALUE(A2) -- #NAME error

--
david
-----------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...fo&userid=2064
View this thread: http://www.excelforum.com/showthread.php?threadid=39057

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Equivalent Of VAL

No, there is no equivalent function. If you know it will only be the 2
leftmost numbers

=Left(A1,2) - Left(A2,2)
would be such an obvious solution that I am sure that is not the case.

--
Regards,
Tom Ogilvy


"davidm" wrote in
message ...

In VBA two cells containing alphanumeric strings like "123abc" can be
subjected to evaluation via the use of VAL. Thus, with "97asd" in A1
and "54jkm" in A2,
Val(Range("a1"))-Val(Range("a2")) yields 43 ~ (97 minus 23).

Is there a Worksheetfunction that perfoms such role? Both the N and
VALUE
Worksheetfunctions failed me in this regard.

=N(A1)-N(A2) -- 0 while VALUE(A1)-VALUE(A2) -- #NAME error.


--
davidm
------------------------------------------------------------------------
davidm's Profile:

http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=390579



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Equivalent Of VAL


Many thanks Tom.
Oftentimes, a confirmatory NO answer is a positive one! It sets the
mind at rest.


--
davidm
------------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=390579

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Equivalent Of VAL

There is no worksheet equivalent. You could write your own custom
function:

Function Val(S As String) As Variant
Val = VBA.Val(S)
End Function

Then, call this function from your worksheet cells.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"davidm"
wrote in message
...

In VBA two cells containing alphanumeric strings like "123abc"
can be
subjected to evaluation via the use of VAL. Thus, with "97asd"
in A1
and "54jkm" in A2,
Val(Range("a1"))-Val(Range("a2")) yields 43 ~ (97 minus 23).

Is there a Worksheetfunction that perfoms such role? Both the
N and
VALUE
Worksheetfunctions failed me in this regard.

=N(A1)-N(A2) -- 0 while VALUE(A1)-VALUE(A2) -- #NAME error.


--
davidm
------------------------------------------------------------------------
davidm's Profile:
http://www.excelforum.com/member.php...o&userid=20645
View this thread:
http://www.excelforum.com/showthread...hreadid=390579



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

Not to mislead, however, you can use a combination of functions in an array
formula to accomplish what you want to do - but that wasn't the question.
Or use a UDF as shown by Chip.

If you need the combination of functions, repost here or ask in
worksheet.functions.

--
Regards,
Tom Ogilvy

"davidm" wrote in
message ...

Many thanks Tom.
Oftentimes, a confirmatory NO answer is a positive one! It sets the
mind at rest.


--
davidm
------------------------------------------------------------------------
davidm's Profile:

http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=390579



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
Function Equivalent need ytayta555 Excel Worksheet Functions 6 May 7th 08 02:53 PM
Equivalent of Alt+Tab for going between worksheets? Jonathan Excel Discussion (Misc queries) 2 May 6th 08 10:29 PM
equivalent for function , please for help ytayta555 Excel Worksheet Functions 5 April 21st 08 02:03 AM
Lotus Equivalent Brian Keanie Excel Discussion (Misc queries) 6 January 2nd 05 10:48 PM
VBA equivalent of findstr lothario[_77_] Excel Programming 2 February 12th 04 03:01 PM


All times are GMT +1. The time now is 02:16 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"