If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Text to Number - Difference between Excel 2000 & 2002
Copied below is the the original problem, converting text to numbers.
Gord, thanks for your reply. I tried this on the same data (which is included as an attachment) on my machine running Excel 2000 on Windows 2000, this returns "No cells found!". However, when I ran it on another machine running Excel 2002 on WinXP, it ran fine, returning just the results I wanted. Is this likely to be a difference between the Excel versions, or something wrong with my settings? I could upgrade to Excel 2002, but this would be a last resort, can anyone suggest a workaround? Bertie. This worked for me on your sheet. Sub NumFormat() Dim cel As Range On Error GoTo endit For Each cel In Selection cel.Value = cel.Value * 1 cel.numberformat = "0.00" Next cel Exit Sub endit: MsgBox "No cells found!" End Sub Gord Dibben Excel MVP On Sat, 21 Aug 2004 06:47:57 -0500, claytorm wrote: Thanks for your replies guys. I finally used Gord Dibben's solution (DataText to ColumnsNextNext "column data format"DateDMYFinish.) which worked well. On a related theme... I still have a problem with some numbers imported as text from the same source. The cells are formatted General, and have 19 spaces after the last digit in each. I have tried several solutions to clean the data and convert it to a number with no success. Some of the solutions I've tried already: I have tried CLEAN, then using VALUE on the result to convert to a number, but this returns #VALUE! I have also tried find and replace on the spaces. I have also tried various macros recommended elsewhere. My thinking is that the spaces are in some way not normal. I attach a sheet with example data. Any comments appreciated. Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=655942 --- Message posted from http://www.ExcelForum.com/ Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=656315 --- Message posted from http://www.ExcelForum.com/ |
#2
|
|||
|
|||
I don't open attachments, but I bet it's differences in data that's causing the
problem. If you've taken the data from a web page, maybe it's those non-breaking HTML thingies. David McRitchie has a macro that cleans up this kind of thing. http://www.mvps.org/dmcritchie/excel/join.htm#trimall (look for "Sub Trimall()") And if you're new to macros, you may want to read David's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm "claytorm " wrote: Copied below is the the original problem, converting text to numbers. Gord, thanks for your reply. I tried this on the same data (which is included as an attachment) on my machine running Excel 2000 on Windows 2000, this returns "No cells found!". However, when I ran it on another machine running Excel 2002 on WinXP, it ran fine, returning just the results I wanted. Is this likely to be a difference between the Excel versions, or something wrong with my settings? I could upgrade to Excel 2002, but this would be a last resort, can anyone suggest a workaround? Bertie. This worked for me on your sheet. Sub NumFormat() Dim cel As Range On Error GoTo endit For Each cel In Selection cel.Value = cel.Value * 1 cel.numberformat = "0.00" Next cel Exit Sub endit: MsgBox "No cells found!" End Sub Gord Dibben Excel MVP On Sat, 21 Aug 2004 06:47:57 -0500, claytorm wrote: Thanks for your replies guys. I finally used Gord Dibben's solution (DataText to ColumnsNextNext "column data format"DateDMYFinish.) which worked well. On a related theme... I still have a problem with some numbers imported as text from the same source. The cells are formatted General, and have 19 spaces after the last digit in each. I have tried several solutions to clean the data and convert it to a number with no success. Some of the solutions I've tried already: I have tried CLEAN, then using VALUE on the result to convert to a number, but this returns #VALUE! I have also tried find and replace on the spaces. I have also tried various macros recommended elsewhere. My thinking is that the spaces are in some way not normal. I attach a sheet with example data. Any comments appreciated. Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=655942 --- Message posted from http://www.ExcelForum.com/ Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=656315 --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
#3
|
|||
|
|||
Dave,
Sorted. Thanks very much. It turned out to be character 160 which is a non-breaking space, so not modified by CLEAN. Thanks for the link to the Macros which did the job perfectly. Bertie --- Message posted from http://www.ExcelForum.com/ |
#4
|
|||
|
|||
Dave
I did open the attached with Excel XP and Windows XP. The code I posted totally ignored the 160's and converted to numbers correctly as claytorm found on his XP setup. Passing strange that the 2000 Excel and Windows OS needed the 160's stripped. This would indicate some sort of OS or Office version functionality. Gord On Sun, 22 Aug 2004 07:07:21 -0500, Dave Peterson wrote: I don't open attachments, but I bet it's differences in data that's causing the problem. If you've taken the data from a web page, maybe it's those non-breaking HTML thingies. David McRitchie has a macro that cleans up this kind of thing. http://www.mvps.org/dmcritchie/excel/join.htm#trimall (look for "Sub Trimall()") And if you're new to macros, you may want to read David's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm "claytorm " wrote: Copied below is the the original problem, converting text to numbers. Gord, thanks for your reply. I tried this on the same data (which is included as an attachment) on my machine running Excel 2000 on Windows 2000, this returns "No cells found!". However, when I ran it on another machine running Excel 2002 on WinXP, it ran fine, returning just the results I wanted. Is this likely to be a difference between the Excel versions, or something wrong with my settings? I could upgrade to Excel 2002, but this would be a last resort, can anyone suggest a workaround? Bertie. This worked for me on your sheet. Sub NumFormat() Dim cel As Range On Error GoTo endit For Each cel In Selection cel.Value = cel.Value * 1 cel.numberformat = "0.00" Next cel Exit Sub endit: MsgBox "No cells found!" End Sub Gord Dibben Excel MVP On Sat, 21 Aug 2004 06:47:57 -0500, claytorm wrote: Thanks for your replies guys. I finally used Gord Dibben's solution (DataText to ColumnsNextNext "column data format"DateDMYFinish.) which worked well. On a related theme... I still have a problem with some numbers imported as text from the same source. The cells are formatted General, and have 19 spaces after the last digit in each. I have tried several solutions to clean the data and convert it to a number with no success. Some of the solutions I've tried already: I have tried CLEAN, then using VALUE on the result to convert to a number, but this returns #VALUE! I have also tried find and replace on the spaces. I have also tried various macros recommended elsewhere. My thinking is that the spaces are in some way not normal. I attach a sheet with example data. Any comments appreciated. Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=655942 --- Message posted from http://www.ExcelForum.com/ Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=656315 --- Message posted from http://www.ExcelForum.com/ |
#5
|
|||
|
|||
On my Windows XP machine, it ran without problems in Excel 2002 and
Excel 2000. On my Windows NT machine, in Excel 2000, I got the error. In both versions, on both machines, it ran without errors if I changed the line to: cel.Value = Replace(cel.Value, Chr(160), "") * 1 Gord Dibben wrote: Dave I did open the attached with Excel XP and Windows XP. The code I posted totally ignored the 160's and converted to numbers correctly as claytorm found on his XP setup. Passing strange that the 2000 Excel and Windows OS needed the 160's stripped. This would indicate some sort of OS or Office version functionality. Gord On Sun, 22 Aug 2004 07:07:21 -0500, Dave Peterson wrote: I don't open attachments, but I bet it's differences in data that's causing the problem. If you've taken the data from a web page, maybe it's those non-breaking HTML thingies. David McRitchie has a macro that cleans up this kind of thing. http://www.mvps.org/dmcritchie/excel/join.htm#trimall (look for "Sub Trimall()") And if you're new to macros, you may want to read David's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm "claytorm " wrote: Copied below is the the original problem, converting text to numbers. Gord, thanks for your reply. I tried this on the same data (which is included as an attachment) on my machine running Excel 2000 on Windows 2000, this returns "No cells found!". However, when I ran it on another machine running Excel 2002 on WinXP, it ran fine, returning just the results I wanted. Is this likely to be a difference between the Excel versions, or something wrong with my settings? I could upgrade to Excel 2002, but this would be a last resort, can anyone suggest a workaround? Bertie. This worked for me on your sheet. Sub NumFormat() Dim cel As Range On Error GoTo endit For Each cel In Selection cel.Value = cel.Value * 1 cel.numberformat = "0.00" Next cel Exit Sub endit: MsgBox "No cells found!" End Sub Gord Dibben Excel MVP On Sat, 21 Aug 2004 06:47:57 -0500, claytorm wrote: Thanks for your replies guys. I finally used Gord Dibben's solution (DataText to ColumnsNextNext "column data format"DateDMYFinish.) which worked well. On a related theme... I still have a problem with some numbers imported as text from the same source. The cells are formatted General, and have 19 spaces after the last digit in each. I have tried several solutions to clean the data and convert it to a number with no success. Some of the solutions I've tried already: I have tried CLEAN, then using VALUE on the result to convert to a number, but this returns #VALUE! I have also tried find and replace on the spaces. I have also tried various macros recommended elsewhere. My thinking is that the spaces are in some way not normal. I attach a sheet with example data. Any comments appreciated. Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=655942 --- Message posted from http://www.ExcelForum.com/ Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=656315 --- Message posted from http://www.ExcelForum.com/ -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
#6
|
|||
|
|||
Thanks Debra.
Not Excel, but Windows NT doing the deed. Gord On Sun, 22 Aug 2004 13:03:25 -0400, Debra Dalgleish wrote: On my Windows XP machine, it ran without problems in Excel 2002 and Excel 2000. On my Windows NT machine, in Excel 2000, I got the error. In both versions, on both machines, it ran without errors if I changed the line to: cel.Value = Replace(cel.Value, Chr(160), "") * 1 Gord Dibben wrote: Dave I did open the attached with Excel XP and Windows XP. The code I posted totally ignored the 160's and converted to numbers correctly as claytorm found on his XP setup. Passing strange that the 2000 Excel and Windows OS needed the 160's stripped. This would indicate some sort of OS or Office version functionality. Gord On Sun, 22 Aug 2004 07:07:21 -0500, Dave Peterson wrote: I don't open attachments, but I bet it's differences in data that's causing the problem. If you've taken the data from a web page, maybe it's those non-breaking HTML thingies. David McRitchie has a macro that cleans up this kind of thing. http://www.mvps.org/dmcritchie/excel/join.htm#trimall (look for "Sub Trimall()") And if you're new to macros, you may want to read David's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm "claytorm " wrote: Copied below is the the original problem, converting text to numbers. Gord, thanks for your reply. I tried this on the same data (which is included as an attachment) on my machine running Excel 2000 on Windows 2000, this returns "No cells found!". However, when I ran it on another machine running Excel 2002 on WinXP, it ran fine, returning just the results I wanted. Is this likely to be a difference between the Excel versions, or something wrong with my settings? I could upgrade to Excel 2002, but this would be a last resort, can anyone suggest a workaround? Bertie. This worked for me on your sheet. Sub NumFormat() Dim cel As Range On Error GoTo endit For Each cel In Selection cel.Value = cel.Value * 1 cel.numberformat = "0.00" Next cel Exit Sub endit: MsgBox "No cells found!" End Sub Gord Dibben Excel MVP On Sat, 21 Aug 2004 06:47:57 -0500, claytorm wrote: Thanks for your replies guys. I finally used Gord Dibben's solution (DataText to ColumnsNextNext "column data format"DateDMYFinish.) which worked well. On a related theme... I still have a problem with some numbers imported as text from the same source. The cells are formatted General, and have 19 spaces after the last digit in each. I have tried several solutions to clean the data and convert it to a number with no success. Some of the solutions I've tried already: I have tried CLEAN, then using VALUE on the result to convert to a number, but this returns #VALUE! I have also tried find and replace on the spaces. I have also tried various macros recommended elsewhere. My thinking is that the spaces are in some way not normal. I attach a sheet with example data. Any comments appreciated. Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=655942 --- Message posted from http://www.ExcelForum.com/ Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=656315 --- Message posted from http://www.ExcelForum.com/ |
#7
|
|||
|
|||
Anyone got a guess why the version of windows would make a difference?
I wouldn't have guessed this. Gord Dibben wrote: Thanks Debra. Not Excel, but Windows NT doing the deed. Gord On Sun, 22 Aug 2004 13:03:25 -0400, Debra Dalgleish wrote: On my Windows XP machine, it ran without problems in Excel 2002 and Excel 2000. On my Windows NT machine, in Excel 2000, I got the error. In both versions, on both machines, it ran without errors if I changed the line to: cel.Value = Replace(cel.Value, Chr(160), "") * 1 Gord Dibben wrote: Dave I did open the attached with Excel XP and Windows XP. The code I posted totally ignored the 160's and converted to numbers correctly as claytorm found on his XP setup. Passing strange that the 2000 Excel and Windows OS needed the 160's stripped. This would indicate some sort of OS or Office version functionality. Gord On Sun, 22 Aug 2004 07:07:21 -0500, Dave Peterson wrote: I don't open attachments, but I bet it's differences in data that's causing the problem. If you've taken the data from a web page, maybe it's those non-breaking HTML thingies. David McRitchie has a macro that cleans up this kind of thing. http://www.mvps.org/dmcritchie/excel/join.htm#trimall (look for "Sub Trimall()") And if you're new to macros, you may want to read David's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm "claytorm " wrote: Copied below is the the original problem, converting text to numbers. Gord, thanks for your reply. I tried this on the same data (which is included as an attachment) on my machine running Excel 2000 on Windows 2000, this returns "No cells found!". However, when I ran it on another machine running Excel 2002 on WinXP, it ran fine, returning just the results I wanted. Is this likely to be a difference between the Excel versions, or something wrong with my settings? I could upgrade to Excel 2002, but this would be a last resort, can anyone suggest a workaround? Bertie. This worked for me on your sheet. Sub NumFormat() Dim cel As Range On Error GoTo endit For Each cel In Selection cel.Value = cel.Value * 1 cel.numberformat = "0.00" Next cel Exit Sub endit: MsgBox "No cells found!" End Sub Gord Dibben Excel MVP On Sat, 21 Aug 2004 06:47:57 -0500, claytorm wrote: Thanks for your replies guys. I finally used Gord Dibben's solution (DataText to ColumnsNextNext "column data format"DateDMYFinish.) which worked well. On a related theme... I still have a problem with some numbers imported as text from the same source. The cells are formatted General, and have 19 spaces after the last digit in each. I have tried several solutions to clean the data and convert it to a number with no success. Some of the solutions I've tried already: I have tried CLEAN, then using VALUE on the result to convert to a number, but this returns #VALUE! I have also tried find and replace on the spaces. I have also tried various macros recommended elsewhere. My thinking is that the spaces are in some way not normal. I attach a sheet with example data. Any comments appreciated. Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=655942 --- Message posted from http://www.ExcelForum.com/ Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=656315 --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
#8
|
|||
|
|||
No idea, but in further tests, it works in Excel 97 on a Windows XP
machine, but not on a Windows 2000 Pro machine. Dave Peterson wrote: Anyone got a guess why the version of windows would make a difference? I wouldn't have guessed this. Gord Dibben wrote: Thanks Debra. Not Excel, but Windows NT doing the deed. Gord On Sun, 22 Aug 2004 13:03:25 -0400, Debra Dalgleish wrote: On my Windows XP machine, it ran without problems in Excel 2002 and Excel 2000. On my Windows NT machine, in Excel 2000, I got the error. In both versions, on both machines, it ran without errors if I changed the line to: cel.Value = Replace(cel.Value, Chr(160), "") * 1 Gord Dibben wrote: Dave I did open the attached with Excel XP and Windows XP. The code I posted totally ignored the 160's and converted to numbers correctly as claytorm found on his XP setup. Passing strange that the 2000 Excel and Windows OS needed the 160's stripped. This would indicate some sort of OS or Office version functionality. Gord On Sun, 22 Aug 2004 07:07:21 -0500, Dave Peterson wrote: I don't open attachments, but I bet it's differences in data that's causing the problem. If you've taken the data from a web page, maybe it's those non-breaking HTML thingies. David McRitchie has a macro that cleans up this kind of thing. http://www.mvps.org/dmcritchie/excel/join.htm#trimall (look for "Sub Trimall()") And if you're new to macros, you may want to read David's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm "claytorm " wrote: Copied below is the the original problem, converting text to numbers. Gord, thanks for your reply. I tried this on the same data (which is included as an attachment) on my machine running Excel 2000 on Windows 2000, this returns "No cells found!". However, when I ran it on another machine running Excel 2002 on WinXP, it ran fine, returning just the results I wanted. Is this likely to be a difference between the Excel versions, or something wrong with my settings? I could upgrade to Excel 2002, but this would be a last resort, can anyone suggest a workaround? Bertie. This worked for me on your sheet. Sub NumFormat() Dim cel As Range On Error GoTo endit For Each cel In Selection cel.Value = cel.Value * 1 cel.numberformat = "0.00" Next cel Exit Sub endit: MsgBox "No cells found!" End Sub Gord Dibben Excel MVP On Sat, 21 Aug 2004 06:47:57 -0500, claytorm wrote: Thanks for your replies guys. I finally used Gord Dibben's solution (DataText to ColumnsNextNext "column data format"DateDMYFinish.) which worked well. On a related theme... I still have a problem with some numbers imported as text from the same source. The cells are formatted General, and have 19 spaces after the last digit in each. I have tried several solutions to clean the data and convert it to a number with no success. Some of the solutions I've tried already: I have tried CLEAN, then using VALUE on the result to convert to a number, but this returns #VALUE! I have also tried find and replace on the spaces. I have also tried various macros recommended elsewhere. My thinking is that the spaces are in some way not normal. I attach a sheet with example data. Any comments appreciated. Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=655942 --- Message posted from http://www.ExcelForum.com/ Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=656315 --- Message posted from http://www.ExcelForum.com/ -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
#9
|
|||
|
|||
Thanks for the info.
Debra Dalgleish wrote: No idea, but in further tests, it works in Excel 97 on a Windows XP machine, but not on a Windows 2000 Pro machine. Dave Peterson wrote: Anyone got a guess why the version of windows would make a difference? I wouldn't have guessed this. Gord Dibben wrote: Thanks Debra. Not Excel, but Windows NT doing the deed. Gord On Sun, 22 Aug 2004 13:03:25 -0400, Debra Dalgleish wrote: On my Windows XP machine, it ran without problems in Excel 2002 and Excel 2000. On my Windows NT machine, in Excel 2000, I got the error. In both versions, on both machines, it ran without errors if I changed the line to: cel.Value = Replace(cel.Value, Chr(160), "") * 1 Gord Dibben wrote: Dave I did open the attached with Excel XP and Windows XP. The code I posted totally ignored the 160's and converted to numbers correctly as claytorm found on his XP setup. Passing strange that the 2000 Excel and Windows OS needed the 160's stripped. This would indicate some sort of OS or Office version functionality. Gord On Sun, 22 Aug 2004 07:07:21 -0500, Dave Peterson wrote: I don't open attachments, but I bet it's differences in data that's causing the problem. If you've taken the data from a web page, maybe it's those non-breaking HTML thingies. David McRitchie has a macro that cleans up this kind of thing. http://www.mvps.org/dmcritchie/excel/join.htm#trimall (look for "Sub Trimall()") And if you're new to macros, you may want to read David's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm "claytorm " wrote: Copied below is the the original problem, converting text to numbers. Gord, thanks for your reply. I tried this on the same data (which is included as an attachment) on my machine running Excel 2000 on Windows 2000, this returns "No cells found!". However, when I ran it on another machine running Excel 2002 on WinXP, it ran fine, returning just the results I wanted. Is this likely to be a difference between the Excel versions, or something wrong with my settings? I could upgrade to Excel 2002, but this would be a last resort, can anyone suggest a workaround? Bertie. This worked for me on your sheet. Sub NumFormat() Dim cel As Range On Error GoTo endit For Each cel In Selection cel.Value = cel.Value * 1 cel.numberformat = "0.00" Next cel Exit Sub endit: MsgBox "No cells found!" End Sub Gord Dibben Excel MVP On Sat, 21 Aug 2004 06:47:57 -0500, claytorm wrote: Thanks for your replies guys. I finally used Gord Dibben's solution (DataText to ColumnsNextNext "column data format"DateDMYFinish.) which worked well. On a related theme... I still have a problem with some numbers imported as text from the same source. The cells are formatted General, and have 19 spaces after the last digit in each. I have tried several solutions to clean the data and convert it to a number with no success. Some of the solutions I've tried already: I have tried CLEAN, then using VALUE on the result to convert to a number, but this returns #VALUE! I have also tried find and replace on the spaces. I have also tried various macros recommended elsewhere. My thinking is that the spaces are in some way not normal. I attach a sheet with example data. Any comments appreciated. Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=655942 --- Message posted from http://www.ExcelForum.com/ Attachment filename: egdata.xls Download attachment: http://www.excelforum.com/attachment.php?postid=656315 --- Message posted from http://www.ExcelForum.com/ -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html -- Dave Peterson |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Save as Web PAge in Excel 2002 | Bob | General Discussion | 1 | June 22nd, 2004 06:41 PM |
Excel 2000 export to Tab deliminated text file - how to control tabs at end of line | BeamGuy | General Discussions | 1 | June 4th, 2004 02:17 PM |
office 2000 remove tools | bud | Setup, Installing & Configuration | 1 | May 27th, 2004 10:40 AM |
Importing unicode text file into Excel 2002 | Isaac Chan | Worksheet Functions | 0 | March 12th, 2004 04:01 AM |
Automatic links shows up as a #Value# error in EXCEL XP but not in EXCEL 2000 | [email protected] | Worksheet Functions | 1 | November 10th, 2003 03:19 AM |