Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
number as text confusing code
I am currently using code to create a table which includes all of the
categories found in a list and the number of times each category is found in the list. As part of this, I have the following line of code: If item = Cells(u + 1, "AR") Then This works great except in once instance where "item" or the contents of cell(u+1, "AR") may be "0". Is there a way to re-write the line so that it is not confused by a number as text? TIA |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
number as text confusing code
One thing you can do is to do a find and replace on 0. When the replace is
done, the text "0" should be magically transformed to the number 0. HTH "Papa Jonah" wrote: I am currently using code to create a table which includes all of the categories found in a list and the number of times each category is found in the list. As part of this, I have the following line of code: If item = Cells(u + 1, "AR") Then This works great except in once instance where "item" or the contents of cell(u+1, "AR") may be "0". Is there a way to re-write the line so that it is not confused by a number as text? TIA |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
number as text confusing code
I don't want text to be numbers. I want the number to be read as text.
"Jim Thomlinson" wrote: One thing you can do is to do a find and replace on 0. When the replace is done, the text "0" should be magically transformed to the number 0. HTH "Papa Jonah" wrote: I am currently using code to create a table which includes all of the categories found in a list and the number of times each category is found in the list. As part of this, I have the following line of code: If item = Cells(u + 1, "AR") Then This works great except in once instance where "item" or the contents of cell(u+1, "AR") may be "0". Is there a way to re-write the line so that it is not confused by a number as text? TIA |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
number as text confusing code
If cstr(item) = Cells(u + 1, "AR").Text Then
perhaps. -- Regards, Tom Ogilvy "Papa Jonah" wrote in message ... I don't want text to be numbers. I want the number to be read as text. "Jim Thomlinson" wrote: One thing you can do is to do a find and replace on 0. When the replace is done, the text "0" should be magically transformed to the number 0. HTH "Papa Jonah" wrote: I am currently using code to create a table which includes all of the categories found in a list and the number of times each category is found in the list. As part of this, I have the following line of code: If item = Cells(u + 1, "AR") Then This works great except in once instance where "item" or the contents of cell(u+1, "AR") may be "0". Is there a way to re-write the line so that it is not confused by a number as text? TIA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
convert text string to a number code | Excel Discussion (Misc queries) | |||
Convert a Number Code to a Text Code | Excel Discussion (Misc queries) | |||
Convert text strings to a code or number | Excel Worksheet Functions | |||
Modified VB Code for Converting Number to Text | Excel Programming | |||
Modified VB Code for Converting Number to Text | Excel Programming |