Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi.
I have a problem. When I import a .txt file create by an accountin software, where there are negative numbers value in this format (fo example 150-), after the importation those numbers have a text forma and I can't sum them with the other numbers. I have a custom forma (#.##0;#.##0-) but I can't apply it after the importation. Can you help me -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
try using 'Data - Text to columns' to convert the negative numbers to rela values -----Original Message----- Hi. I have a problem. When I import a .txt file create by an accounting software, where there are negative numbers value in this format (for example 150-), after the importation those numbers have a text format and I can't sum them with the other numbers. I have a custom format (#.##0;#.##0-) but I can't apply it after the importation. Can you help me? --- Message posted from http://www.ExcelForum.com/ . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Doesn't work in Excel 2000 or Excel 97 at least. (as far as reevaluating
the cells. If you meant to separate the number from the negative sign, that would be different). -- Regards, Tom Ogilvy "Frank Kabel" wrote in message ... Hi try using 'Data - Text to columns' to convert the negative numbers to rela values -----Original Message----- Hi. I have a problem. When I import a .txt file create by an accounting software, where there are negative numbers value in this format (for example 150-), after the importation those numbers have a text format and I can't sum them with the other numbers. I have a custom format (#.##0;#.##0-) but I can't apply it after the importation. Can you help me? --- Message posted from http://www.ExcelForum.com/ . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In most cases, a format does not affect what is stored in the cell. Excel
sees 150- as a string. Therefore, you number format has no effect. You can use a macro to fix them Select the cells and run a macro like this Sub PostfixNegative() Dim rng as Range, cell as Range if selection.count 1 then On Error Resume Next set rng = selection.specialCells(xlConstants,xlTextValues) On Error goto 0 else set rng = selection End if if not rng is nothing then for each cell in rng if Right(trim(cell.value),1) = "-" then Cell.Value = cdbl(cell.Value) end if Next End if End Sub -- Regards, Tom Ogilvy "fragher75 " wrote in message ... Hi. I have a problem. When I import a .txt file create by an accounting software, where there are negative numbers value in this format (for example 150-), after the importation those numbers have a text format and I can't sum them with the other numbers. I have a custom format (#.##0;#.##0-) but I can't apply it after the importation. Can you help me? --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 format cells to date format | Excel Discussion (Misc queries) | |||
How to format cells in Excel 2007 (i.e. currency format)? | Excel Discussion (Misc queries) | |||
want format cells alignment not format cells font style | Excel Discussion (Misc queries) | |||
Cells won't convert to number format, even after format/cells/num. | Excel Discussion (Misc queries) | |||
When I select "format cells", the format dialog box does not disp. | Excel Worksheet Functions |