+ Reply to Thread
Results 1 to 5 of 5

Set value of cell if text in adjacent cell is "Bold"

  1. #1
    Registered User
    Join Date
    08-11-2011
    Location
    Louisiana
    MS-Off Ver
    Excel 2016 & 365
    Posts
    39

    Set value of cell if text in adjacent cell is "Bold"

    Hello,

    I am trying to create a macro/script that will set the value of a cell if the text in a cell 2 columns over is bold.
    The bold cell would always be in column A.

    Can anyone help?

    I believe I would want to use this:
    Range("A2").Select Selection.Font.Bold = True

  2. #2
    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
    52,939

    Re: Set value of cell if text in adjacent cell is "Bold"

    if there is some criteria that determines why the value in A1 would be bold, you could use this same criteria in conditional formatting, instead of VBA
    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

  3. #3
    Registered User
    Join Date
    08-11-2011
    Location
    Louisiana
    MS-Off Ver
    Excel 2016 & 365
    Posts
    39

    Re: Set value of cell if text in adjacent cell is "Bold"

    It doesn't have any other special characteristic. I'm creating a tab delimited text file from a .rtf to be uploaded. The Bolded text represents the correct answer. If the letter representing the answer is bold, I want to make the cell 2 columns to the right equal to "correct".

  4. #4
    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
    52,939

    Re: Set value of cell if text in adjacent cell is "Bold"

    ok then some1 will have to help you with some VBA code, sorry

  5. #5
    Registered User
    Join Date
    08-11-2011
    Location
    Louisiana
    MS-Off Ver
    Excel 2016 & 365
    Posts
    39

    Re: Set value of cell if text in adjacent cell is "Bold"

    I found this online.


    Function checkbold(xa As Range)

    checkbold = xa.Font.Bold

    End Function

    Source: http://www.excelvbamacros.com/2010/1...ld-or-not.html

    It works well. This formula does what I want it to do, though a macro would be quicker.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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