+ Reply to Thread
Results 1 to 15 of 15

If a name in one range exists in another, then make that name bold....

Hybrid View

  1. #1
    Registered User
    Join Date
    01-11-2016
    Location
    USA
    MS-Off Ver
    2007
    Posts
    22

    If a name in one range exists in another, then make that name bold....

    N13:N175 contains names
    C13:C60 contains names

    If any names in N13:N175 exist in C13:C60 then make those names bold in N13:N60

    Thanks!

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: If a name in one range exists in another, then make that name bold....

    Hello rcicconetti,

    Have you tried Conditional formatting?

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: If a name in one range exists in another, then make that name bold....

    I would do this using MATCH and Conditional Formatting.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: If a name in one range exists in another, then make that name bold....

    @ FDibbins,

    I "hate" you, because you are correct. I assumed linear data.

    Thank you for your valued input!

    Best Regards.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: If a name in one range exists in another, then make that name bold....

    Hey boetman welcome back. No, you could be correct, depends what the OP is dealing with

  6. #6
    Registered User
    Join Date
    01-11-2016
    Location
    USA
    MS-Off Ver
    2007
    Posts
    22

    Re: If a name in one range exists in another, then make that name bold....

    How would the macro be written?

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: If a name in one range exists in another, then make that name bold....

    It's not a macro, it's a built-in function.

    Can you shows us some sample data?

  8. #8
    Registered User
    Join Date
    01-11-2016
    Location
    USA
    MS-Off Ver
    2007
    Posts
    22

    Re: If a name in one range exists in another, then make that name bold....

    I have a dynamic list of names in C13:C60. (List of Managers)
    There are several corresponding lists, waiters, bussers etc.
    They all populate another list, N13:N250.
    I want to distinguish the Managers in N13:N150 by making them Bold.Italic
    No matter how I format the cells in C13:C60, after they are transferred to N13:N250, they take on the formatting value (regular) of those cells.

    Here is the full code, It's lengthy so I'll bold where the transfer takes place:
    Sub UpdateSchedule()
    '
    '
    ' Update Schedule Macro
    
    Range("C13:C60").Select
        Range("C60").Activate
        Application.CutCopyMode = False
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Add Key:=Range("C60"), _
            SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort
            .SetRange Range("C13:C60")
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    ' SortPieman Macro
    '
    Range("E13:E60").Select
        Range("E60").Activate
        Application.CutCopyMode = False
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Add Key:=Range("E60"), _
            SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort
            .SetRange Range("E13:E60")
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    ' SortWaiter Macro
    '
    Range("G13:G60").Select
        Range("G60").Activate
        Application.CutCopyMode = False
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Add Key:=Range("G60"), _
            SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort
            .SetRange Range("G13:G60")
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    ' SortBusser Macro
    '
    Range("I13:I60").Select
        Range("I60").Activate
        Application.CutCopyMode = False
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Add Key:=Range("I60"), _
            SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort
            .SetRange Range("I13:I60")
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    '' SortDriver Macro
    '
    Range("K13:K60").Select
        Range("K60").Activate
        Application.CutCopyMode = False
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Add Key:=Range("K60"), _
            SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort
            .SetRange Range("K13:K60")
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
       Range("C13:C60").Select
        ActiveSheet.Unprotect
        Range("N151:U151").Select
        With Selection
            .HorizontalAlignment = xlGeneral
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = True
        End With
        Selection.unmerge
        Range("C13:C60").Select
        Selection.Copy
        Range("N23").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("E13:E60").Select
        Selection.Copy
        Range("N70").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
        Range("G13:G60").Select
        Selection.Copy
        Range("N118").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
        Range("I13:I60").Select
        Selection.Copy
        Range("N166").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
        Range("K13:K60").Select
        Selection.Copy
        Range("N214").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
        Range("N23:N275").Select
        ActiveSheet.Range("$N$23:$N$275").RemoveDuplicates Columns:=1, Header:=xlNo
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Add Key _
            :=Range("N261"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
            :=xlSortNormal
        With ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort
            .SetRange Range("N23:N261")
            .Header = xlNo
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
        Range("N22:N150").Select
         
        
        With Selection.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .ThemeColor = xlThemeColorDark2
            .TintAndShade = -9.99786370433668E-02
            .PatternTintAndShade = 0
        End With
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlInsideVertical)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlInsideHorizontal)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlInsideVertical)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlInsideHorizontal)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        With Selection.Borders(xlInsideHorizontal)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        ActiveWindow.SmallScroll Down:=129
        Range("N151:U151").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        With Selection.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .ThemeColor = xlThemeColorDark2
            .TintAndShade = -9.99786370433668E-02
            .PatternTintAndShade = 0
        End With
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
        Dim x, y, i As Long, e, dic As Object
        Set dic = CreateObject("Scripting.Dictionary")
        dic.CompareMode = 1
        x = [if((X7:BS55<>"")*(countif(c13:k95,X7:BS55)=0),X7:BS55,char(2))]
        For i = 1 To UBound(x)
            y = Filter(Application.Index(x, i, 0), Chr(2), 0)
            If UBound(y) > -1 Then
                For Each e In y
                    dic(e) = Empty
                Next
            End If
        Next
        Range("C8").Select
        If dic.Count Then MsgBox "Please Unschedule" & vbLf & Join(dic.keys, vbLf), 16
        ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
        
    End Sub
    Last edited by rcicconetti; 01-13-2016 at 07:12 PM.

  9. #9
    Registered User
    Join Date
    01-11-2016
    Location
    USA
    MS-Off Ver
    2007
    Posts
    22

    Re: If a name in one range exists in another, then make that name bold....

    I figured I could add some type of command at the end of this code to say:
    If a name in N13:N250 exists in C13:C60, Then make it Bold.Italic

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: If a name in one range exists in another, then make that name bold....

    Hi rcicconetti,

    If you have managed to solve your issue, then please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Thanks.

  11. #11
    Registered User
    Join Date
    01-11-2016
    Location
    USA
    MS-Off Ver
    2007
    Posts
    22

    Re: If a name in one range exists in another, then make that name bold....

    Winon,
    The issue hasn't been solved. Can you help?

  12. #12
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: If a name in one range exists in another, then make that name bold....

    Hello rcicconetti,

    ...It's lengthy so I'll bold where the transfer takes place:
    I cannot see where the transfer takes places with this Code you have pasted in Bold.

    Range("C13:C60").Select
        Range("C60").Activate
        Application.CutCopyMode = False
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Add Key:=Range("C60"), _
            SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort
            .SetRange Range("C13:C60")
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    Please could you attach a sample workbook.

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    Also please try to compile the Sample Workbook with all the Macros in place as well.

    I suspect it may have to do with this line of Code, further down your Module;

    ... Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    Regards.

  13. #13
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: If a name in one range exists in another, then make that name bold....

    Hi, rcicconetti,

    maybe try the first part (as I dont recommend to merge cells the bordering and merging is excluded). And rows 13 to 60 make up 48 rows for me while you only add 47 for the next area to copy to...

    Sub UpdateSchedule()
    '
    '
    ' Update Schedule Macro
    
    Dim lngCtr As Long
    Dim lngLine As Long
    Dim ws As Worksheet
    
    Set ws = ActiveWorkbook.Worksheets("Scheduling Assistant 1.0")
    For lngCtr = 3 To 11 Step 2
      With ws.Sort
        With .SortFields
          .Clear
          .Add Key:=ws.Cells(60, lngCtr), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        End With
        .SetRange ws.Range(ws.Cells(13, lngCtr), ws.Cells(60, lngCtr))
        .Header = xlGuess
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
      End With
    Next lngCtr
        
    ws.Unprotect
    With Range("N151:U151")
      .HorizontalAlignment = xlGeneral
      .VerticalAlignment = xlBottom
      .WrapText = False
      .Orientation = 0
      .AddIndent = False
      .IndentLevel = 0
      .ShrinkToFit = False
      .ReadingOrder = xlContext
      .MergeCells = True
      .UnMerge
    End With
    lngLine = 23
    For lngCtr = 3 To 11
      ws.Cells(13, lngCtr).Resize(48, 1).Copy
      ws.Range("N" & lngLine).Resize(48, 1).PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
            SkipBlanks:=False, Transpose:=False
      ws.Range("N" & lngLine).Resize(48, 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
            SkipBlanks:=False, Transpose:=False
      lngLine = lngLine + 48
    Next lngLine
        
    ws.Range("$N$23:$N$" & lngLine - 48).RemoveDuplicates Columns:=1, Header:=xlNo
        
    With ws.Sort
      With .SortFields
        .Clear
        .Add Key:=ws.Range("N23"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
      End With
      .SetRange ws.Range("N23:N" & ws.Cells(ws.Rows.Count, "N").End(xlUp).Row)
      .Header = xlNo
      .MatchCase = False
      .Orientation = xlTopToBottom
      .SortMethod = xlPinYin
      .Apply
    End With
    
    'no further
    Code is untested so errors may be raised.

    Ciao,
    Holger
    Last edited by HaHoBe; 01-17-2016 at 06:51 AM.
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  14. #14
    Registered User
    Join Date
    01-11-2016
    Location
    USA
    MS-Off Ver
    2007
    Posts
    22

    Re: If a name in one range exists in another, then make that name bold....

    Scheduling Assistant 1.xlsmScheduling Assistant 1.xlsm
    Here is the full code, It's lengthy so I'll bold where the transfer takes place. There was also an error in my original explanation....N13:N250 should have read N23:N150 as it does below.

    The lines where the transfer occurs is in bold. Last version I had the wrong area set. Thanks for your assistance!!!


    I have a dynamic list of names in C13:C60. (List of Managers)
    There are several corresponding lists, waiters, bussers etc.
    They all populate another list, N23:N250.
    I want to distinguish the Managers in N23:N150 by making them Bold.Italic
    No matter how I format the cells in C13:C60, after they are transferred to N23:N250, they take on the formatting value (regular) of those cells.


    Sub UpdateSchedule()
    '
    '
    ' Update Schedule Macro
    
        Range("C13:C60").Select
        Range("C60").Activate
        Application.CutCopyMode = False
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Add Key:=Range("C60"), _
            SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort
            .SetRange Range("C13:C60")
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    ' SortPieman Macro
    '
    Range("E13:E60").Select
        Range("E60").Activate
        Application.CutCopyMode = False
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Add Key:=Range("E60"), _
            SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort
            .SetRange Range("E13:E60")
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    ' SortWaiter Macro
    '
    Range("G13:G60").Select
        Range("G60").Activate
        Application.CutCopyMode = False
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Add Key:=Range("G60"), _
            SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort
            .SetRange Range("G13:G60")
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    ' SortBusser Macro
    '
    Range("I13:I60").Select
        Range("I60").Activate
        Application.CutCopyMode = False
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Add Key:=Range("I60"), _
            SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort
            .SetRange Range("I13:I60")
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    '' SortDriver Macro
    '
    Range("K13:K60").Select
        Range("K60").Activate
        Application.CutCopyMode = False
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Add Key:=Range("K60"), _
            SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort
            .SetRange Range("K13:K60")
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
       Range("C13:C60").Select
        ActiveSheet.Unprotect
        Range("N151:U151").Select
        With Selection
            .HorizontalAlignment = xlGeneral
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = True
        End With
        Selection.unmerge
        Range("C13:C60").Select
        Selection.Copy
        Range("N23").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("E13:E60").Select
        Selection.Copy
        Range("N70").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
        Range("G13:G60").Select
        Selection.Copy
        Range("N118").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
        Range("I13:I60").Select
        Selection.Copy
        Range("N166").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
        Range("K13:K60").Select
        Selection.Copy
        Range("N214").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
            xlNone, SkipBlanks:=False, Transpose:=False
        Range("N23:N275").Select
        ActiveSheet.Range("$N$23:$N$275").RemoveDuplicates Columns:=1, Header:=xlNo
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort.SortFields.Add Key _
            :=Range("N261"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
            :=xlSortNormal
        With ActiveWorkbook.Worksheets("Scheduling Assistant 1.0").Sort
            .SetRange Range("N23:N261")
            .Header = xlNo
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
        Range("N22:N150").Select
         
        
        With Selection.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .ThemeColor = xlThemeColorDark2
            .TintAndShade = -9.99786370433668E-02
            .PatternTintAndShade = 0
        End With
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlInsideVertical)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlInsideHorizontal)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlInsideVertical)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        With Selection.Borders(xlInsideHorizontal)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        With Selection.Borders(xlInsideHorizontal)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
        ActiveWindow.SmallScroll Down:=129
        Range("N151:U151").Select
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlBottom
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .IndentLevel = 0
            .ShrinkToFit = False
            .ReadingOrder = xlContext
            .MergeCells = False
        End With
        Selection.Merge
        With Selection.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .ThemeColor = xlThemeColorDark2
            .TintAndShade = -9.99786370433668E-02
            .PatternTintAndShade = 0
        End With
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
        Selection.Borders(xlInsideVertical).LineStyle = xlNone
        Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
        Dim x, y, i As Long, e, dic As Object
        Set dic = CreateObject("Scripting.Dictionary")
        dic.CompareMode = 1
        x = [if((X7:BS55<>"")*(countif(c13:k95,X7:BS55)=0),X7:BS55,char(2))]
        For i = 1 To UBound(x)
            y = Filter(Application.Index(x, i, 0), Chr(2), 0)
            If UBound(y) > -1 Then
                For Each e In y
                    dic(e) = Empty
                Next
            End If
        Next
        Range("C8").Select
        If dic.Count Then MsgBox "Please Unschedule" & vbLf & Join(dic.keys, vbLf), 16
        ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
        
    End Sub

  15. #15
    Registered User
    Join Date
    05-03-2011
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Excel 2016
    Posts
    98

    Re: If a name in one range exists in another, then make that name bold....

    hi. I have a idea. try it.

    First u try to get those values are Dublin ate. If the value is Duplicate than that cell value need to bold
    ok
    cell (1,1).font.bold = true
    use this code. that eg cell (1,1) u change to that DupliDuplicate value

+ 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] Make the Zero line bold
    By mra1984 in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 09-08-2017, 06:27 PM
  2. Make the number bold
    By pietka in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-16-2014, 04:51 AM
  3. [SOLVED] Make string bold
    By Justair07 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-30-2013, 02:33 PM
  4. [SOLVED] how do i make certain words bold?
    By pablowilks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2013, 02:48 PM
  5. how can I make this BOLD?
    By Mamud in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-22-2012, 06:15 AM
  6. Conditional Format-make bold the lowest value in a range
    By uplink600 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-21-2007, 07:47 AM
  7. Make string bold?
    By Adam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2005, 11:07 AM

Tags for this Thread

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