Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text entries behaving like numbers jkiser Excel Discussion (Misc queries) 12 August 30th 06 09:29 PM
Why are 1/2 my numbers imported as text and the rest as numbers? KBear Excel Discussion (Misc queries) 2 April 21st 06 01:40 PM
VLOOKUP should compare numbers stored as text to plain numbers. VLOOKUP - Numbers stored as text Excel Worksheet Functions 0 March 31st 06 05:53 PM
Numbers stored as text causes problem with VLOOKUP bpeltzer Excel Worksheet Functions 0 February 4th 06 08:07 PM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM


All times are GMT +1. The time now is 04:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"