Solved

excel format number

Posted on 2008-10-04
1
216 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

695 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