Solved

excel format number

Posted on 2008-10-04
1
214 Views
Last Modified: 2012-05-05
For some reason I have a column and the positive/negative sign follows the number like 10.22+ or 45.55-.

Excel does not recognize this as a number.  How can I get the + or - before the number instead of after it?

I tried selecting everything, and formatting, but that did not work.
0
Comment
Question by:jackjohnson44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 22641669
You're going to need a little macro help. The routines below convert negative numeric values with trailing negative signs (e.g., "123-") into numeric values. When entering or importing such values Excel interprets them as text instead of numeric values.

Select the cells to convert and run the macro ConvertTrailingNegativeValuesDefault.

[Begin Code Segment]

Public Sub ConvertTrailingNegativeValuesDefault()

' Call the routine ConvertTrailingNegativeValues using the current selection.

   ConvertTrailingNegativeValues Selection
   
End Sub


Public Sub ConvertTrailingNegativeValues( _
      ByVal Target As Range _
   )

' Convert any numeric values with trailing negative signs to numeric values.
'
' Syntax
'
' ConvertTrailingNegativeValues(Target)
'
' Target - The range containing the values to convert.

   Dim Cell As Range

   For Each Cell In Target
      If Len(Cell) > 1 Then
         If VarType(Cell) = vbString Then
            If Right(Cell, 1) = "-" And IsNumeric(Left(Cell, Len(Cell) - 1)) Then
               Cell = CDbl(Cell)
            End If
         End If
      End If
   Next Cell

End Sub

[End Code Segment]

Kevin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
EXCEL Name Matching 13 38
Determine dependencies 3 21
split data by day 21 31
Help to find the duplicates 8 17
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question