+ Reply to Thread
Results 1 to 3 of 3

Highlight leading and trailing spaces of text within cells

  1. #1
    Registered User
    Join Date
    04-12-2016
    Location
    Oklahoma, USA
    MS-Off Ver
    Office 2007-2010
    Posts
    30

    Highlight leading and trailing spaces of text within cells

    I need a macro that will highlight (in yellow) the spaces within a cell that lead or trail a string of text. The spaces between the words or values should not be highlighted. Also, I am not wanting to color the entire cell. I would like to run the macro for all cells in a worksheet.

    Any thoughts?

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Highlight leading and trailing spaces of text within cells

    Interesting - you cannot highlight a space...

    As there is no 'text' (so to speak) in a space character, you cannot highlight a leading or trailing space and change the font colour. You also cannot use a fill, or background, colour as that applies to the whole cell only.

    Your best bet is Conditional Formatting but that can only work on a cell basis.

  3. #3
    Forum Contributor kalbasiatka's Avatar
    Join Date
    02-27-2016
    Location
    Brest, Belarus
    MS-Off Ver
    2021
    Posts
    224

    Re: Highlight leading and trailing spaces of text within cells

    In excel there is no backlighting of symbols, there is color. But in any case it is impossible to illuminate a space.
    Maybe remove the extreme spaces of the macro?
    To do it for me and help me it is 2 different things!
    Sorry for my english, blame Google translator

+ 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. [SOLVED] Remove leading and trailing spaces in a cell?
    By LF_CC in forum Excel General
    Replies: 4
    Last Post: 12-05-2013, 03:12 PM
  2. Remove leading, trailing & non-breaking spaces on a worksheet
    By Kennethc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-06-2013, 07:03 PM
  3. insert leading or trailing spaces
    By 2008 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-05-2013, 08:58 PM
  4. [SOLVED] Removing leading and trailing spaces
    By mangesh in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-18-2013, 05:25 AM
  5. delete leading trailing and excessive spaces
    By djwaz69 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-28-2012, 03:59 AM
  6. [SOLVED] Strip Leading and Trailing Spaces
    By Vladamir in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2012, 03:46 PM
  7. Deleting leading and trailing spaces from a number
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-31-2009, 11:25 PM
  8. How keep Leading/Trailing spaces when save in Excel?
    By jorgejulio in forum Excel General
    Replies: 0
    Last Post: 08-01-2006, 04:49 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