+ Reply to Thread
Results 1 to 5 of 5

Formula to insert special character in a string

  1. #1
    Registered User
    Join Date
    05-14-2021
    Location
    India
    MS-Off Ver
    Office 10
    Posts
    18

    Formula to insert special character in a string

    Hi,
    I have string in Column B.

    I need vba to find first alphabet (a-z) and insert character "^".

    Please refer attachment, in b2 I have a string in C2 first alphabet is f. Hence "^" symbol is inserted before f.
    Attached Files Attached Files

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Formula to insert special character in a string

    VBA solution:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Valued Forum Contributor
    Join Date
    05-03-2022
    Location
    Halifax,Canada
    MS-Off Ver
    365
    Posts
    326

    Re: Formula to insert special character in a string

    METHOD A
    Please Login or Register  to view this content.
    METHOD B
    Please Login or Register  to view this content.
    Assumption: Works if the last digits before the letters is a 4 digit year ... as is in all your examples
    Last edited by nimrod1313; 08-10-2022 at 05:49 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    05-03-2022
    Location
    Halifax,Canada
    MS-Off Ver
    365
    Posts
    326

    Re: Formula to insert special character in a string

    updated code from last post so that the "intent" is clearer

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by nimrod1313; 08-11-2022 at 10:18 AM.

  5. #5
    Valued Forum Contributor
    Join Date
    05-03-2022
    Location
    Halifax,Canada
    MS-Off Ver
    365
    Posts
    326

    Re: Formula to insert special character in a string

    SOLUTION IF YEAR ASSUMPTION IS INVALID
    (i.e. traversing the string looking for the change from numbers to letters.)

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA function: Insert character every X special character
    By Ralleberg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-04-2022, 09:28 AM
  2. insert special character in an empty cell
    By xam99 in forum Excel General
    Replies: 2
    Last Post: 02-12-2020, 03:28 PM
  3. Delete Row with string containing special character
    By DoodlesMama in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-24-2014, 06:02 PM
  4. [SOLVED] Finding special character in a string
    By sathishkm in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-01-2013, 06:10 AM
  5. [SOLVED] extract string after nth string (special character)
    By itselflearn in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-24-2013, 03:18 PM
  6. remove special character at end of string
    By captain bob in forum Excel General
    Replies: 0
    Last Post: 08-03-2006, 09:59 AM
  7. Insert a special character before and after a word
    By Venkatesh V in forum Excel General
    Replies: 1
    Last Post: 02-21-2005, 11:06 AM

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