+ Reply to Thread
Results 1 to 3 of 3

hard coded text

  1. #1
    William Benson
    Guest

    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. #2
    K Dales
    Guest

    RE: 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. #3
    William Benson
    Guest

    Re: hard coded text

    Thanks a million!

    "K Dales" <[email protected]> wrote in message
    news:[email protected]...
    >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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1