Results 1 to 3 of 3

Insert column Text after first non blank character

Threaded View

  1. #1
    Registered User
    Join Date
    07-30-2017
    Location
    US
    MS-Off Ver
    MS 10
    Posts
    4

    Insert column Text after first non blank character

    I would like to modify this macro to insert a string character after encountering the first non-blank character in a column.
    example: my data is in col A (The row count varies)
    ----------
    "When working in Excel, you can often undo the actions "
    "you must change it so that it references the directory "
    disabled when saving a workbook
    Pay special attention to range
    You must click the Enable option in the yellow

    I would like the output to be

    "Insert HereWhen working in Excel, you can often undo the actions "
    "Insert Hereyou must change it so that it references the directory "
    dInsert Hereisabled when saving a workbook
    PInsert Hereay special attention to range
    YInsert Hereou must click the Enable option in the yellow


    My current code

    
    Sub addcomment()
     Dim Rng As Range
        Dim a As Range
        On Error Resume Next
               For Each a In Selection
            a.Value = Left(a.Value, 1) & "Insert Here " & Mid(a.Value, 2, Len(a.Value) - 1)
        Next
    End Sub
    Last edited by rexrundajets; 02-16-2018 at 07:03 PM. Reason: thanks updating with Code Tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Insert blank row after each cell that contains text in column A
    By anrichards22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-14-2013, 03:10 AM
  2. Replies: 5
    Last Post: 04-26-2013, 08:32 PM
  3. [SOLVED] Long String of text and need to insert space every 8th character
    By jbang917 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-12-2013, 03:45 PM
  4. Replies: 3
    Last Post: 11-08-2012, 05:01 PM
  5. How to Insert a character between existing characters in a text string?
    By forti2ude95 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-08-2012, 12:35 PM
  6. Insert new row when the 3rd character in Column changes
    By kibbles in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2010, 01:52 PM
  7. insert character into string in entire column
    By Onestopfanshop in forum Excel General
    Replies: 6
    Last Post: 10-05-2010, 09:20 AM
  8. Replies: 5
    Last Post: 04-23-2010, 09:34 PM

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