Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA Numbers to Text or Date to Text
Note to Google Search Groups
Populating worksheet cells with information that looks like numbers or date-like functions i.e. MONTH(), DAY() etc, Excel may "assume" what you mean, which in turn, can cause unexpected issues later. For example, I had sheetnames "Jan06", Feb06 etc. I transferred the sheet names to another worksheet's cells. When done, the cell information became 1-06. When I wanted to compare information and/or "Goto" those sheets, Jan06 is very different from 1-06. Therefore, to force Numbers to Text or Date to Text, consider concatenating Range("B2").Value = "'" & Range("A1").Text or Range("B2").Value = "'" & Activesheet.name to force Excel to interpret that Jan06 as Jan06 and not 1-06. Simularly: To force Excel to intrepret 1234 as Text: Range("B2").Value = "'" & Range("A1") HTH EagleOne |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text entries behaving like numbers | Excel Discussion (Misc queries) | |||
Why are 1/2 my numbers imported as text and the rest as numbers? | Excel Discussion (Misc queries) | |||
VLOOKUP should compare numbers stored as text to plain numbers. | Excel Worksheet Functions | |||
Numbers stored as text causes problem with VLOOKUP | Excel Worksheet Functions | |||
Formulas dealing with text data | Excel Worksheet Functions |