+ Reply to Thread
Results 1 to 6 of 6

Partial Formatting

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Partial Formatting

    Hi All

    I'm trying to use conditional formatting to find and format a given character in a cell , and all content in the cell that follows it.

    For example , with the trigger character of '&' :

    John & Jill
    Bill & Sarah
    Julie & Steven

    Would become

    John & Jill
    Bill & Sarah
    Julie & Steven

    I haven't been able to find a way via conditional formatting thus far , so I'm hoping someone can help.

    Failing this , could someone suggest some VBA code to do the job? Essentially it would need to find and colour the selected character and the rest of the characters following it in the cell.

    Grateful for any advice.
    Last edited by CDandVinyl; 01-22-2020 at 12:35 PM.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,734

    Re: Partial Formatting

    It cannot be done with CF, but it is possible as long the values are hard values & not a formula.

    Do you just want to look for the & sign and what cells should this work on?

  3. #3
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Partial Formatting

    Thanks for getting back.

    Yes , all the values are hard text values. In my own case here the best character to look for would be a dot (.) in each of the cells H5:H300.

    I'd be looking to colour the first dot and everything after it white if possible please.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,734

    Re: Partial Formatting

    Ok, how about
    Sub CDandVinyl()
       Dim Cl As Range
       Dim i As Long
       
       For Each Cl In Range("H5:H300")
          i = InStr(1, Cl.Value, ".")
          If i > 0 Then Cl.Characters(i, Len(Cl.Value)).Font.Color = vbWhite
       Next Cl
    End Sub

  5. #5
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Partial Formatting

    OK That's perfect. Thanks. It worked first time.

    Problem solved!

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,734

    Re: Partial Formatting

    You're welcome & thanks for the feedback

+ 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. Partial Formatting of Header Text
    By emerson098 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2019, 06:26 AM
  2. Conditional Formatting that contain text and partial
    By nathanexcelhelp in forum Excel General
    Replies: 4
    Last Post: 02-17-2017, 09:26 AM
  3. Conditional Formatting: Matching Partial Text
    By Alan_Bernardo in forum Excel General
    Replies: 1
    Last Post: 01-07-2017, 02:23 PM
  4. finding formatting of partial cell
    By hemiceni in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-27-2016, 09:34 PM
  5. incorporate the formatting from the “Partial” column to the “Complete”?
    By JMJ123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-24-2013, 01:12 PM
  6. Conditional Formatting Partial Match
    By n3sky in forum Excel General
    Replies: 4
    Last Post: 10-24-2011, 11:40 PM
  7. MsgBox--partial formatting
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-04-2005, 09:49 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