Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Change negative sign from end of number to the beginning of the number.

I need to scan financial reports to a file so that I can then manipulate
columns of figures. I can do this using an OCR program and saving as an
Excel file.

The reports have the negative sign at the end of the number but Excel
requiires it at the begiinning.

eg: 1234.56- needs to convert to -1234.56

Is there a way that I can convert a whole column

--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default Change negative sign from end of number to the beginning of the nu

Does this work for you:

Sub ConvertNeg()
Dim rng As Range
Dim oCell As Range

Set rng = Range("B1:B100")
For Each oCell In rng
If Right(oCell, 1) = "-" Then
oCell = Left(oCell, Len(oCell) - 1) * -1
End If
Next
Set rng = Nothing
End Sub

"GORDON SCALES via OfficeKB.com" wrote:

I need to scan financial reports to a file so that I can then manipulate
columns of figures. I can do this using an OCR program and saving as an
Excel file.

The reports have the negative sign at the end of the number but Excel
requiires it at the begiinning.

eg: 1234.56- needs to convert to -1234.56

Is there a way that I can convert a whole column

--
Message posted via http://www.officekb.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Change negative sign from end of number to the beginning of the number.

Gordon,

Try this, you will have to change the sheet and range to suit your data.

Sub ChangeMinus()
'changes the minus sing on the right of the number
'which is actually shown as text to the left
'so that it becomes a negative number
Dim checkRange As Range
Dim Cell As Range
Set checkRange = Sheets(2).Range("D:I")
For Each Cell In checkRange
If Right(Cell.Value, 1) = "-" And Left(Cell.Value, 1) < "-" Then
Cell.Value = "-" &
Application.WorksheetFunction.Substitute(Cell.Valu e, "-", " ")
End If
Next
End Sub

Regards
Neil

"GORDON SCALES via OfficeKB.com" wrote in message
...
I need to scan financial reports to a file so that I can then manipulate
columns of figures. I can do this using an OCR program and saving as an
Excel file.

The reports have the negative sign at the end of the number but Excel
requiires it at the begiinning.

eg: 1234.56- needs to convert to -1234.56

Is there a way that I can convert a whole column

--
Message posted via http://www.officekb.com



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Change negative sign from end of number to the beginning of the nu

thanks guys,

--
Message posted via http://www.officekb.com
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
Change positive number to negative number Angie M. Excel Worksheet Functions 1 January 25th 10 05:49 AM
How do I change the sign of a base number for use in XIRR? Dick Cheatham Excel Discussion (Misc queries) 1 October 31st 06 06:41 PM
change negative sign from end of the number to the begining James Excel Discussion (Misc queries) 11 September 23rd 06 05:36 PM
Change Number to a negative in VBA Noemi Excel Discussion (Misc queries) 2 November 22nd 05 11:58 AM
2003= negative number&2004= negative number How Do I Calculate gro Jason Excel Worksheet Functions 1 January 14th 05 05:24 PM


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