Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help!: Converting "1,253-" to "-1,253"


Guys,

Can anybody help me convert a number say, "1,253-" to "-1,253"

Let's say that the data is in column G.

The database usually put the negative sign at the end and excel read
this as text.

I hope somebody can help me create a macro for this.

:)


--
japorms
------------------------------------------------------------------------
japorms's Profile: http://www.excelforum.com/member.php...fo&userid=6544
View this thread: http://www.excelforum.com/showthread...hreadid=533523

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Help!: Converting "1,253-" to "-1,253"

Select the cells with the data you want to change, then run the
following macro:

Sub ChangeNeg()
Dim Rng As Range
Dim Pos As Long
For Each Rng In Selection.Cells
If Right(Rng.Text, 1) = "-" Then
Rng.Value = Left(Rng.Text, Len(Rng.Text) - 1) * -1
End If
Next Rng
End Sub

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


"japorms"
wrote in message
...

Guys,

Can anybody help me convert a number say, "1,253-" to "-1,253"

Let's say that the data is in column G.

The database usually put the negative sign at the end and excel
read
this as text.

I hope somebody can help me create a macro for this.

:)


--
japorms
------------------------------------------------------------------------
japorms's Profile:
http://www.excelforum.com/member.php...fo&userid=6544
View this thread:
http://www.excelforum.com/showthread...hreadid=533523



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Help!: Converting "1,253-" to "-1,253"

Hey, also get yourself this free excel utility called ASAP. You'll love
it. www.asap-utilities.com

john

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help!: Converting "1,253-" to "-1,253"


Thanks Guys!

You all have very helpful.

Its working perfectly.

I use the one Chip suggested. Thanks Chip!

:)


--
japorms
------------------------------------------------------------------------
japorms's Profile: http://www.excelforum.com/member.php...fo&userid=6544
View this thread: http://www.excelforum.com/showthread...hreadid=533523

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
Converting "uppercase" string data to "lower case" in CSV file [email protected] Excel Discussion (Misc queries) 2 August 12th 08 08:36 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


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