Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Subject: How to Reverse Contents in an Excel cell (NUMERIC VALUE)

Ok, followed this in an Excel2003 workbook, and got ALMOST there. I was able
to get the reverse returned, but then adding the *1 returned a #VALUE! error.
Clicking the error tab did not give me the option to Convert To Number,
either.
If its any help, this is what I want to accomplish:
start with a number:
(ABC)
add its reverse (here is where I need the function)
ABC+CBA = XYZ
So:
A1 is (ABC)
B1 is (CBA)
C1 is A2 + B2 [XYZ]

THEN -
A2 = (XYZ)
B2 = (ZYX)

etc.

Any suggestions?


"Gord Dibben" wrote:

CeeGee

By using a user defined function.

Public Function RevStr(Rng As Range)
RevStr = StrReverse(Rng.text)
End Function

Usage is: =RevStr(cellref)

If the data is numeric...... =RevStr(cellref)*1 which forces it back to
numeric.

This function would be copied to a general module in your workbook.

If not familiar with macros and VBA, visit David McRitchie's website on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the above code in there. Save the
workbook and hit ALT + Q to return to your workbook.


Gord Dibben Excel MVP

On Fri, 20 May 2005 15:16:02 -0700, CeeGee
wrote:

If I have the following text string in a cell "abc123.xyz" how do I reverse
the contents i.e. "zyx.321cba"?

If the cell contains a numeric value e.g. 12345, then I want to know how to
reverse it i.e. 54321




  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Subject: How to Reverse Contents in an Excel cell (NUMERIC VALUE)

Try

=VALUE(RevStr(cellref))

HTH,
Bernie
MS Excel MVP


"3kings" wrote in message
...
Ok, followed this in an Excel2003 workbook, and got ALMOST there. I was able
to get the reverse returned, but then adding the *1 returned a #VALUE! error.
Clicking the error tab did not give me the option to Convert To Number,
either.
If its any help, this is what I want to accomplish:
start with a number:
(ABC)
add its reverse (here is where I need the function)
ABC+CBA = XYZ
So:
A1 is (ABC)
B1 is (CBA)
C1 is A2 + B2 [XYZ]

THEN -
A2 = (XYZ)
B2 = (ZYX)

etc.

Any suggestions?


"Gord Dibben" wrote:

CeeGee

By using a user defined function.

Public Function RevStr(Rng As Range)
RevStr = StrReverse(Rng.text)
End Function

Usage is: =RevStr(cellref)

If the data is numeric...... =RevStr(cellref)*1 which forces it back to
numeric.

This function would be copied to a general module in your workbook.

If not familiar with macros and VBA, visit David McRitchie's website on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the above code in there. Save the
workbook and hit ALT + Q to return to your workbook.


Gord Dibben Excel MVP

On Fri, 20 May 2005 15:16:02 -0700, CeeGee
wrote:

If I have the following text string in a cell "abc123.xyz" how do I reverse
the contents i.e. "zyx.321cba"?

If the cell contains a numeric value e.g. 12345, then I want to know how to
reverse it i.e. 54321






  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Subject: How to Reverse Contents in an Excel cell (NUMERIC VAL

Nope, that didnt work either... :-(

"Bernie Deitrick" wrote:

Try

=VALUE(RevStr(cellref))

HTH,
Bernie
MS Excel MVP


"3kings" wrote in message
...
Ok, followed this in an Excel2003 workbook, and got ALMOST there. I was able
to get the reverse returned, but then adding the *1 returned a #VALUE! error.
Clicking the error tab did not give me the option to Convert To Number,
either.
If its any help, this is what I want to accomplish:
start with a number:
(ABC)
add its reverse (here is where I need the function)
ABC+CBA = XYZ
So:
A1 is (ABC)
B1 is (CBA)
C1 is A2 + B2 [XYZ]

THEN -
A2 = (XYZ)
B2 = (ZYX)

etc.

Any suggestions?


"Gord Dibben" wrote:

CeeGee

By using a user defined function.

Public Function RevStr(Rng As Range)
RevStr = StrReverse(Rng.text)
End Function

Usage is: =RevStr(cellref)

If the data is numeric...... =RevStr(cellref)*1 which forces it back to
numeric.

This function would be copied to a general module in your workbook.

If not familiar with macros and VBA, visit David McRitchie's website on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the above code in there. Save the
workbook and hit ALT + Q to return to your workbook.


Gord Dibben Excel MVP

On Fri, 20 May 2005 15:16:02 -0700, CeeGee
wrote:

If I have the following text string in a cell "abc123.xyz" how do I reverse
the contents i.e. "zyx.321cba"?

If the cell contains a numeric value e.g. 12345, then I want to know how to
reverse it i.e. 54321






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default Subject: How to Reverse Contents in an Excel cell (NUMERIC VAL

both

=1*RevStr(cellref)

and

=VALUE(RevStr(cellref))

work for me.

What happens when you try? And where did you place the function code that
Gord provided?


"3kings" wrote:

Nope, that didnt work either... :-(

"Bernie Deitrick" wrote:

Try

=VALUE(RevStr(cellref))

HTH,
Bernie
MS Excel MVP


"3kings" wrote in message
...
Ok, followed this in an Excel2003 workbook, and got ALMOST there. I was able
to get the reverse returned, but then adding the *1 returned a #VALUE! error.
Clicking the error tab did not give me the option to Convert To Number,
either.
If its any help, this is what I want to accomplish:
start with a number:
(ABC)
add its reverse (here is where I need the function)
ABC+CBA = XYZ
So:
A1 is (ABC)
B1 is (CBA)
C1 is A2 + B2 [XYZ]

THEN -
A2 = (XYZ)
B2 = (ZYX)

etc.

Any suggestions?


"Gord Dibben" wrote:

CeeGee

By using a user defined function.

Public Function RevStr(Rng As Range)
RevStr = StrReverse(Rng.text)
End Function

Usage is: =RevStr(cellref)

If the data is numeric...... =RevStr(cellref)*1 which forces it back to
numeric.

This function would be copied to a general module in your workbook.

If not familiar with macros and VBA, visit David McRitchie's website on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the above code in there. Save the
workbook and hit ALT + Q to return to your workbook.


Gord Dibben Excel MVP

On Fri, 20 May 2005 15:16:02 -0700, CeeGee
wrote:

If I have the following text string in a cell "abc123.xyz" how do I reverse
the contents i.e. "zyx.321cba"?

If the cell contains a numeric value e.g. 12345, then I want to know how to
reverse it i.e. 54321






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default Subject: How to Reverse Contents in an Excel cell (NUMERIC VAL

didn't work is a very helpful reply. Was the reason like me you don't have
the "StrReverse" keywork in VBA?

If so try:

Public Function RevStr(Rng As Range)
For cX = Len(Rng) To 1 Step -1
sStr = sStr & Mid(Rng, cX, 1)
Next cX
RevStr = sStr
End Function

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"3kings" wrote in message
...
Nope, that didnt work either... :-(

"Bernie Deitrick" wrote:

Try

=VALUE(RevStr(cellref))

HTH,
Bernie
MS Excel MVP


"3kings" wrote in message
...
Ok, followed this in an Excel2003 workbook, and got ALMOST there. I was
able
to get the reverse returned, but then adding the *1 returned a #VALUE!
error.
Clicking the error tab did not give me the option to Convert To Number,
either.
If its any help, this is what I want to accomplish:
start with a number:
(ABC)
add its reverse (here is where I need the function)
ABC+CBA = XYZ
So:
A1 is (ABC)
B1 is (CBA)
C1 is A2 + B2 [XYZ]

THEN -
A2 = (XYZ)
B2 = (ZYX)

etc.

Any suggestions?


"Gord Dibben" wrote:

CeeGee

By using a user defined function.

Public Function RevStr(Rng As Range)
RevStr = StrReverse(Rng.text)
End Function

Usage is: =RevStr(cellref)

If the data is numeric...... =RevStr(cellref)*1 which forces it back
to
numeric.

This function would be copied to a general module in your workbook.

If not familiar with macros and VBA, visit David McRitchie's website
on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic
Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the above code in there. Save
the
workbook and hit ALT + Q to return to your workbook.


Gord Dibben Excel MVP

On Fri, 20 May 2005 15:16:02 -0700, CeeGee

wrote:

If I have the following text string in a cell "abc123.xyz" how do I
reverse
the contents i.e. "zyx.321cba"?

If the cell contains a numeric value e.g. 12345, then I want to know
how to
reverse it i.e. 54321











  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 258
Default Subject: How to Reverse Contents in an Excel cell (NUMERIC VALUE)

3kings --
I can see how to do it w/out VBA if all your original numbers have the same
number of digits. However, if they have different numbers of digits, then I
suspect it would take a VBA snippet.

Idle curiosity -- why are you trying to do this?

"3kings" wrote:

Ok, followed this in an Excel2003 workbook, and got ALMOST there. I was able
to get the reverse returned, but then adding the *1 returned a #VALUE! error.
Clicking the error tab did not give me the option to Convert To Number,
either.
If its any help, this is what I want to accomplish:
start with a number:
(ABC)
add its reverse (here is where I need the function)
ABC+CBA = XYZ
So:
A1 is (ABC)
B1 is (CBA)
C1 is A2 + B2 [XYZ]

THEN -
A2 = (XYZ)
B2 = (ZYX)

etc.

Any suggestions?


"Gord Dibben" wrote:

CeeGee

By using a user defined function.

Public Function RevStr(Rng As Range)
RevStr = StrReverse(Rng.text)
End Function

Usage is: =RevStr(cellref)

If the data is numeric...... =RevStr(cellref)*1 which forces it back to
numeric.

This function would be copied to a general module in your workbook.

If not familiar with macros and VBA, visit David McRitchie's website on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the above code in there. Save the
workbook and hit ALT + Q to return to your workbook.


Gord Dibben Excel MVP

On Fri, 20 May 2005 15:16:02 -0700, CeeGee
wrote:

If I have the following text string in a cell "abc123.xyz" how do I reverse
the contents i.e. "zyx.321cba"?

If the cell contains a numeric value e.g. 12345, then I want to know how to
reverse it i.e. 54321




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
Subject: How to Reverse Contents in an Excel cell (NUMERIC VALUE) 3kings Excel Worksheet Functions 1 September 13th 07 06:45 PM
How to Reverse Contents in an Excel cell (Text or a Number) CeeGee Excel Worksheet Functions 5 September 13th 07 06:22 PM
NEW QUEST/REQ in "How to Reverse Contents ..." Pls Respond? TIA 3kings Excel Worksheet Functions 0 September 13th 07 05:14 PM
only extract numeric value from alpha numeric cell Fam via OfficeKB.com Excel Discussion (Misc queries) 5 April 26th 06 06:49 PM
Using VB, specific cell data into email subject andrew Excel Discussion (Misc queries) 1 January 26th 05 05:53 PM


All times are GMT +1. The time now is 05:14 AM.

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"