Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default hard coded text

Is there a test (in VBA) specifically whether a cell has an apostrophe in
the formula ...i.e., that it has been hardcoded by the user as text?
Similarly, is there a way through VBA to insert the same hard-coded text
into a cell.

Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default hard coded text

A cell's Range.PrefixCharacter property will tell what that 'prefix' is, so
If Range("A1").PrefixCharacter = "'" Then ...
should allow you to detect the apostrophe.

To insert text with this prefix, just enter the value as you would type it,
i.e. (note the apostophe inside the first quotation mark):
Range("B1").Value = "'456"

"William Benson" wrote:

Is there a test (in VBA) specifically whether a cell has an apostrophe in
the formula ...i.e., that it has been hardcoded by the user as text?
Similarly, is there a way through VBA to insert the same hard-coded text
into a cell.

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default hard coded text

Thanks a million!

"K Dales" wrote in message
...
A cell's Range.PrefixCharacter property will tell what that 'prefix' is, so
If Range("A1").PrefixCharacter = "'" Then ...
should allow you to detect the apostrophe.

To insert text with this prefix, just enter the value as you would type
it,
i.e. (note the apostophe inside the first quotation mark):
Range("B1").Value = "'456"

"William Benson" wrote:

Is there a test (in VBA) specifically whether a cell has an apostrophe in
the formula ...i.e., that it has been hardcoded by the user as text?
Similarly, is there a way through VBA to insert the same hard-coded text
into a cell.

Thanks.





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
Combo Box / Hard Coded List trip_to_tokyo[_3_] Excel Discussion (Misc queries) 1 January 2nd 10 11:31 AM
Hard coded formula fix, VBA for column ordering undrline via OfficeKB.com Excel Worksheet Functions 2 September 14th 08 08:53 AM
do the same thing to multiple hard coded cells Sam Excel Worksheet Functions 3 March 7th 08 11:07 PM
vba(SOX): ftp connection & hard coded password Gurinder Excel Programming 1 February 23rd 05 03:36 PM
Find Hard Coded Cells Steph[_3_] Excel Programming 3 November 7th 04 04:18 PM


All times are GMT +1. The time now is 09:26 AM.

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"