+ 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
    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.
    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] .

  2. #2
    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

+ 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