+ Reply to Thread
Results 1 to 11 of 11

Help inserting formatted text in a cell

  1. #1
    Registered User
    Join Date
    11-29-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2013
    Posts
    62

    Help inserting formatted text in a cell

    I am hoping that someone can help me if this can be done.
    I want to paste some formatted text inside an excel cell.
    It can be done by macro or a cut and paste.
    If using a macro, I do not want to apply a macro to a whole cell.

    I want to insert some formatted text into an already existing cell that has text in it.
    Using a macro or a cut and paste would work, if I could figure out how to do it, if it can be done.

    I have included a before and after of a sample of what I would like it to do or work.
    In the first image titled “Before macro or paste” you can notice that there is no icon and the word Pharmacy.
    In the second image titles “After macro or paste” you can see the icon and the word Pharmacy that I would like to insert.

    The icon is a font that I created, and the word Pharmacy is Tahoma 10.
    I would like to double click within the existing cell and place the curser where I want to wither execute the macros or paste the formatted text and insert it.
    I have tried doing a cut and paste but it only inserts the text with the current font that is in the cell. The font I want does not follow it when I paste it. I am not familiar with creating a macro that would do this.

    Is there any way this can be done?
    Macro-n.png
    Macro-y.png

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Help inserting formatted text in a cell

    Hi, does this help?

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    11-29-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Help inserting formatted text in a cell

    Quote Originally Posted by sweep View Post
    Hi, does this help?
    As I said. I really don't know anything about creating macros.
    So that all looks Greek to me.
    I did play around with it and tried to get it work with no luck but that's because I do not know the macro language.

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Help inserting formatted text in a cell

    OK,

    To put the code into your workbook..

    Press ALT+F11 - This will open the Visual Basic Applications Editor

    From the menu select, "Insert", then "Module"

    Paste the code above into the window that appears.

    Close the editor (X top right)

    In the workbook, enter some text into cell A1, then from the menu select "Developer", click "Macros" and then Macro name "a"

    You should see some extra text appear in the middle of the cell and change font to Wingdings.

    Drop a line back when you've got that working and we'll figure out how to do exactly what you're after.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Help inserting formatted text in a cell

    attroll,

    Can you upload a workbook showing before/after, so that we can upload your workbook with the macro code.

    To upload a file click the Go Advanced button at the foot of your post, look underneath the post area for the Manage Attachments section and take it from there.

  6. #6
    Registered User
    Join Date
    11-29-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Help inserting formatted text in a cell

    Yes, I could get that working.
    I tweak it just a little. I will attach a small sample spreadsheet. This will not display as it does in mine because I have special fonts that I am using.
    I am sure you can get this working.

    Let me explain a little more.
    There are three different fonts that I need to insert in this macro. I have attached another image that should explain that.
    I am not going to want it in the 6th position on A1 every time.
    The position changes in every cell that I want to place this in.
    Also, when I place this using a macro, I don’t want to lose any of the existing formatting that I already have within the cell.

    Thank you for the help. I hope you can help me further.
    Attached Images Attached Images
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Help inserting formatted text in a cell

    I've looked at the workbook, but I don't find what is before and what you want after macro...

    So, write a code like Range.Characters(x,y).Insert and change the font one by one...

  8. #8
    Registered User
    Join Date
    11-29-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Help inserting formatted text in a cell

    I was not thinking in respects of what is before or after the macro.
    It does not follow and certain routine as to where is gets placed.

    I just want to be able to insert and assigned set of formatted text it into cell by double click the cell and placing the cursor where I want it in the cell text, then inserting it there.
    Sort of like cut and pasting, in a sense.

    I have tried the cutting and pasting but when I double click into the cell and place my cursor where I want the formatted text to be placed and paste it, the font does not follow. It goes to the font is in that location of the cell.

    Basically, I would be happy with finding a way to double click into the cell and placing my cursor in the location where I want this formatted text to go and inserting it somehow with a macro or some type of shortcut key.

    Here is the text that I would like to inset, see below.
    +[]

    However, there are two different fonts that are being used in this text that I need to stay with it.
    + is one font#1.
    [] is another font#2.

    I am hoping that what I am saying here makes sense to you.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Help inserting formatted text in a cell

    That's impossible.

    The best you can do is to specify where/what to insert and font details somehow.

  10. #10
    Registered User
    Join Date
    11-29-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Help inserting formatted text in a cell

    I cannot figure out how to do it. I have tried everything that I know.
    I do not know how to write macros. Is a macros the only way this can be done?

    Here is the text that I would like to inset, see below (each letter is a different font).
    +[]

    However, there are two different fonts that are being used in this text that I need to stay with it when it is placed in the location.
    + is font#1.
    [] is font#2.

  11. #11
    Registered User
    Join Date
    11-29-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Help inserting formatted text in a cell

    Sorry I misread the previous post. I thought you said that that was possible.
    I see now that you said it was impossible.
    If it's impossible then I will have to keep doing it the hard way, like I have been doing.

    Thank you for trying to help me. I really do appreciate it.

+ 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. Replies: 10
    Last Post: 08-17-2020, 02:33 AM
  2. Is a cell containing a number really formatted as Text?
    By spshipley in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-13-2016, 10:17 AM
  3. Converting a formatted cell to text
    By nps1976 in forum Excel General
    Replies: 9
    Last Post: 08-08-2014, 02:43 AM
  4. [SOLVED] Inserting Formatted Table Via Mail Merge
    By k64 in forum Word Formatting & General
    Replies: 8
    Last Post: 05-07-2014, 01:15 PM
  5. Assign value to text formatted cell
    By LTCGene in forum Excel General
    Replies: 2
    Last Post: 12-30-2008, 04:36 AM
  6. Help on inserting rows and formatted content
    By tanyhart in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-06-2006, 12:38 PM
  7. Converting 'General' formatted cells to Text formatted cell using.
    By Zahid Khan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-12-2005, 04:06 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