LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Detecting a single quote from a cells value

I need to know when the input data contains the prefixed single quote to
force the data to be treated like text.

I am showing SQL table data that contains scripting commands. The presence
of a single tick indicates that this script command is a comment. I want to
process through my script commands and turn the font to green when the script
command being displayed in a cell is a comment.

How do I detect the presence of a prefixed single quote in a cell from VBA?
Left$(cell.value, 1) = "'" is never true because excel strips this
character from the value (although it is still shown in the formula bar)
Neither does the cell.formula show the prefixed single quote (this seems
like it should though)

Is my only option to process the SQL-recordset field to look for the single
quote? I'm hoping that excel's object model has some way to detect the
forcing of a cells value to text.

--
Regards,
John
 
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
vlookup and using single quote Bishop Excel Worksheet Functions 2 April 3rd 09 06:02 PM
Remove single quote Avadivelan TCS Excel Worksheet Functions 4 October 5th 06 03:48 PM
Removing leading single quote (') from cells with Search/Replace Arun Excel Discussion (Misc queries) 3 January 22nd 06 03:40 AM
Leading single quote AA2e72E Excel Programming 2 May 13th 05 11:33 AM
Single quote in a where clause Poh[_2_] Excel Programming 0 July 9th 04 02:54 AM


All times are GMT +1. The time now is 05:20 PM.

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

About Us

"It's about Microsoft Excel"