+ Reply to Thread
Results 1 to 8 of 8

Italicize only the first line of a two text line cell

  1. #1
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    Italicize only the first line of a two text line cell

    Hi everyone.
    I have a column - F6:F797 - with two lines of text (with a line break between them) in each cell. I need to apply italic to the first line of each one. I found this VBA code that does that, but needs adapting to serve my purpose. I'm no VBA savvy so I'd appreciate the help.

    Please Login or Register  to view this content.
    Credits to a SiddharthRout from Experts-Exchange forum.

    Thank you.

    PR

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Italicize only the first line of a two text line cell

    Hi,

    It appears all you need is to alter the range? If so
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    Re: Italicize only the first line of a two text line cell

    Thank you for the fast reply.
    Forgot to ask: where do I paste this code in the VBA window?

    PR

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Italicize only the first line of a two text line cell

    If you don't already have that code attached to a button (which is how it is intended), I would add it to a normal module in your workbook (Insert- Module in the VB Editor if you do not already have a module present) and make it public rather than private so you can run it from the macros dialog or assign it a shortcut key
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    Re: Italicize only the first line of a two text line cell

    That's it. There's just one tiny issue - it's applying italic to the second line and not the first one.
    Thank you.

    PR

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Italicize only the first line of a two text line cell

    So it is! Perhaps this instead
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    Re: Italicize only the first line of a two text line cell

    Perfect! You were most helpful. Thank you very much.

    PR

  8. #8
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Italicize only the first line of a two text line cell

    You're welcome- it was my pleasure.

+ 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: 3
    Last Post: 03-12-2017, 03:39 PM
  2. [SOLVED] Reading line by line data from Text file
    By wyldencl in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-18-2015, 10:09 PM
  3. [SOLVED] Wanted: Highlight last line of text and copy to line below
    By King_Crud in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-17-2014, 08:01 AM
  4. analyzing text file line by line
    By HarryKlein in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-16-2011, 12:20 PM
  5. Read the text in a single cell line by line.
    By moon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2010, 06:23 AM
  6. Replies: 6
    Last Post: 07-12-2005, 04:05 PM
  7. Reading a text file line by line
    By Foss in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-16-2005, 12: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