Results 1 to 5 of 5

Thread: adding bold to only the changed cell values

  1. #1

    adding bold to only the changed cell values



    Register for a FREE account, and/
    or Log in to avoid these ads!

    This code searches through Col 2 and then find the first alpha letter and replaces it with just the first letter of the alpha''
    such as the following:

    Col1, . ,Col2
    ID, , Name

    12220001 , ,adamsS
    44522522 , , jones
    32511321 , ,macabe
    645464 , , macdemo
    2654654, , macmonagle
    15651 , ,mcginty
    65464 , ,smith
    54566 , ,Willison
    654654 , ,willlaimson

    Col1, Col2
    A, , adamsS
    J, , jones
    M, , macabe
    645464, , macdemo
    2654654, , macmonagle
    15651, , mcginty
    S, , smith
    W, , Willison
    654654, , willlaimson


    Code:
    Sub test()
    With Range("b1", Range("b" & Rows.Count).End(xlUp))
      .Offset(, -1).Value = Evaluate("if(countif(offset(" & .Address & ",,,row(1:" & .Rows.Count & ")),left(" & .Address & ",1)&""*"")=1,upper(left(" & .Address & ",1))," & .Offset(, -1).Address & ")")
    End With
    End Sub
    such as

    .Font.Bold = True
    .HorizontalAlignment = xlRight

    any help would be helpful
    thanks in advance
    Last edited by p45cal; 2015-11-07 at 04:15 PM. Reason: added code tags

  2. #2
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,512
    Articles
    0
    Excel Version
    365
    try:
    Code:
    Sub blah()
    For Each cll In Range("b2", Range("b" & Rows.Count).End(xlUp)).Cells
      If Application.WorksheetFunction.CountIf(Range(Range("B2"), cll), Left(cll.Value, 1) & "*") = 1 Then
        With cll.Offset(, -1)
          .Value = UCase(Left(cll.Value, 1))
          .Font.Bold = True
          .HorizontalAlignment = xlRight
        End With
      End If
    Next cll
    End Sub

  3. #3

    changed cells on in bold

    Quote Originally Posted by p45cal View Post
    try:
    Code:
    Sub blah()
    For Each cll In Range("b2", Range("b" & Rows.Count).End(xlUp)).Cells
      If Application.WorksheetFunction.CountIf(Range(Range("B2"), cll), Left(cll.Value, 1) & "*") = 1 Then
        With cll.Offset(, -1)
          .Value = UCase(Left(cll.Value, 1))
          .Font.Bold = True
          .HorizontalAlignment = xlRight
        End With
      End If
    Next cll
    End Sub
    any one know how to amend the above to just bolding out the changes/changed cells only

  4. #4
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,512
    Articles
    0
    Excel Version
    365
    Quote Originally Posted by gint32 View Post
    any one know how to amend the above to just bolding out the changes/changed cells only
    ?!? Have you actually tried this?
    Before:


    After:

    Here you can see that only the letters A,J,M, S and W are bold.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	BeforeCapture.JPG 
Views:	20 
Size:	23.5 KB 
ID:	4123   Click image for larger version. 

Name:	AfterCapture.JPG 
Views:	21 
Size:	21.5 KB 
ID:	4124  

  5. #5

    Cool

    Sorry it works a treat,...many thanks
    Last edited by p45cal; 2015-11-08 at 10:45 PM. Reason: removed unnecessary quote of complete previous message

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •