View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Changing 1234.00- to -1234.00 automatically

Select the range.

DataText to ColumnsNextNextAdvanced. Checkmark in "trailing minus sign for
negative numbers"Finish.

A macro if you wish.

Sub Negsignleft()
Dim cell As Range
Dim rng As Range
''move minus sign from right to left on entire worksheet
On Error Resume Next
Set rng = ActiveSheet.Cells. _
SpecialCells(xlCellTypeConstants, xlTextValues)
On Error GoTo 0
For Each cell In rng
If IsNumeric(cell.Value) Then
cell.Value = CDbl(cell.Value)
End If
Next cell
End Sub


Gord Dibben MS Excel MVP


On Thu, 28 Sep 2006 09:41:03 -0700, Lisa wrote:

Everyday I have to copy and paste data from a program to an excel
spreadsheet. Positive numbers come in fine, negative numbers don't. They
align to the left of the cell with the negative sign to the right of the
numbers. Currently I: F2, backspace, home, put in the - sign and enter to
the next cell where I repeat this approximately 80 times.
I have tried setting up a macro, a scenerio, and a what if function, but
with no luck on any of them. The macro was my best guess, but it saves the
number along with the steps, so everyday the numbers revert back to the ones
saved in the macro not what they should be.
Does anyone have a solution for quickly changing the format of these numbers
after they are pasted in?