Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default Need to move - from end of number to beginning

Hi! I've got a large workbook containing many numbers that should be
negative. For some reason, the - is showing up at the end of the number. I
believe the document was converted to Excel. Anyway, I want to quickly move
the - from the end to the beginning of the number, then format the cell as
number. Any ideas how to do that?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Need to move - from end of number to beginning

On Tue, 1 Apr 2008 06:35:01 -0700, Giggly4g
wrote:

Hi! I've got a large workbook containing many numbers that should be
negative. For some reason, the - is showing up at the end of the number. I
believe the document was converted to Excel. Anyway, I want to quickly move
the - from the end to the beginning of the number, then format the cell as
number. Any ideas how to do that?


Select the cells, one column at a time.

Then Select Data/Text to columns (or on the Data tab of 2007)

At step 3 of the Wizard, select Advanced and ensure that "Trailing minus for
negative numbers" is Set.

Finish.
--ron
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Need to move - from end of number to beginning

Data/ Text to columns/ ... should do the trick. One stage of the wizard has
an Advanced menu, including the option for trailing minus (which may be set
by default).
--
David Biddulph

"Giggly4g" wrote in message
...
Hi! I've got a large workbook containing many numbers that should be
negative. For some reason, the - is showing up at the end of the number. I
believe the document was converted to Excel. Anyway, I want to quickly
move
the - from the end to the beginning of the number, then format the cell as
number. Any ideas how to do that?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 747
Default Need to move - from end of number to beginning

Use this ....

Select the range first ..


Sub reverse()

For Each r In Selection
With r
.Value = -(.Value)
End With
Selection.Value = -r
Next r
End Sub



On Apr 1, 7:31*pm, "David Biddulph" <groups [at] biddulph.org.uk
wrote:
Data/ Text to columns/ ... should do the trick. *One stage of the wizard has
an Advanced menu, including the option for trailing minus (which may be set
by default).
--
David Biddulph

"Giggly4g" wrote in message

...



Hi! I've got a large workbook containing many numbers that should be
negative. For some reason, the - is showing up at the end of the number. I
believe the document was converted to Excel. Anyway, I want to quickly
move
the - from the end to the beginning of the number, then format the cell as
number. Any ideas how to do that?- Hide quoted text -


- Show quoted text -


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default Need to move - from end of number to beginning

Excel doesn't like .Value = -(.Value)

I tried using (.Value)- since the - is at the end. Didn't work. I'm getting
a syntax error message.

I'd try using text to columns but there are over 800 columns to do.


"muddan madhu" wrote:

Use this ....

Select the range first ..


Sub reverse()

For Each r In Selection
With r
.Value = -(.Value)
End With
Selection.Value = -r
Next r
End Sub



On Apr 1, 7:31 pm, "David Biddulph" <groups [at] biddulph.org.uk
wrote:
Data/ Text to columns/ ... should do the trick. One stage of the wizard has
an Advanced menu, including the option for trailing minus (which may be set
by default).
--
David Biddulph

"Giggly4g" wrote in message

...



Hi! I've got a large workbook containing many numbers that should be
negative. For some reason, the - is showing up at the end of the number. I
believe the document was converted to Excel. Anyway, I want to quickly
move
the - from the end to the beginning of the number, then format the cell as
number. Any ideas how to do that?- Hide quoted text -


- Show quoted text -





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Need to move - from end of number to beginning

On Tue, 1 Apr 2008 09:21:04 -0700, Giggly4g
wrote:

I'd try using text to columns but there are over 800 columns to do.


Try this sub, then:

=========================
Option Explicit
Sub TrailingNeg()
Dim c As Range
For Each c In Cells.SpecialCells(xlCellTypeConstants)
With c
If IsNumeric(.Value) And _
Right(.Value, 1) = "-" Then
.Value = Val(.Value) * -1
End If
End With
Next c
End Sub
===========================
--ron
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 747
Default Need to move - from end of number to beginning

try this

.value = .value

It's working ...

On Apr 1, 9:21*pm, Giggly4g
wrote:
Excel doesn't like .Value = -(.Value)

I tried using (.Value)- since the - is at the end. Didn't work. I'm getting
a syntax error message.

I'd try using text to columns but there are over 800 columns to do.



"muddan madhu" wrote:
Use this ....


Select the range first ..


Sub reverse()


For Each r In Selection
With r
.Value = -(.Value)
End With
Selection.Value = -r
Next r
End Sub


On Apr 1, 7:31 pm, "David Biddulph" <groups [at] biddulph.org.uk
wrote:
Data/ Text to columns/ ... should do the trick. *One stage of the wizard has
an Advanced menu, including the option for trailing minus (which may be set
by default).
--
David Biddulph


"Giggly4g" wrote in message


...


Hi! I've got a large workbook containing many numbers that should be
negative. For some reason, the - is showing up at the end of the number. I
believe the document was converted to Excel. Anyway, I want to quickly
move
the - from the end to the beginning of the number, then format the cell as
number. Any ideas how to do that?- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


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
How do I keep the 0 at the beginning of a number, ex. 090? linds.hope New Users to Excel 1 October 30th 07 09:59 PM
shortcut key to move to beginning of new row bob engler Excel Worksheet Functions 2 April 23rd 06 08:01 PM
need enter key to move to the next column beginning j pantozzi Excel Worksheet Functions 2 December 5th 05 05:57 PM
Zero at the beginning of a number Zeros at the front of numbers Excel Discussion (Misc queries) 4 April 11th 05 02:58 PM
Shortcut key to move to beginning of a worksheet Martha Excel Discussion (Misc queries) 1 February 22nd 05 08:53 PM


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