+ Reply to Thread
Results 1 to 4 of 4

Find cell content and format cell accordingly

  1. #1
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    Find cell content and format cell accordingly

    Hi,

    I have some useful code to find specific content in a column and format it. My problem at this point is, how do I tell Excel to look for any content within the given range and then format it as indicated? Most cells within the range will be empty, and just a few will have content (either numbers or text). Those are the ones I need formatted. Additionally, I need to introduce the offset property to format the corresponding cell in column A the same as the one in column L (That is, same row, but cell in column A). What do I have to adjust within this code? Is there any better approach to this?

    Thanks for any help!

    (I'm using a "?" sign in the sample below to indicate the piece of code I'm looking for)

    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Find cell content and format cell accordingly

    First of all, it might be easier and all around better to do this with conditional formatting. But here is the answer to your question.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    04-20-2013
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: Find cell content and format cell accordingly

    Hi Jeff!,

    Thank you so much for your help. Adjusting the line of code where the value is set, made the trick. However, the second part of your code, the one marked in red, didn't do anything. I came up with a solution that worked, this is the code:


    Please Login or Register  to view this content.
    Since this worked, I'm marking this post as solved.

    Thank you again!

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Find cell content and format cell accordingly

    I made an error. In that code

    With ActiveSheet.Cells(cell.Row, "L")

    should be

    With ActiveSheet.Cells(cell.Row, "A")

    A suggestion to attach a file in future threads--if I had your file I would have tested it before posting. Thanks.

+ 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. Delete cell content if find a space in relative cell reference
    By kent97 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-05-2015, 12:43 AM
  2. [SOLVED] multiple find and replace cell content based on another cell
    By betatony in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-27-2014, 03:07 PM
  3. Replies: 1
    Last Post: 06-26-2013, 01:51 PM
  4. Changing the Format and content of a cell dependant on another cell
    By BigEye64 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-23-2013, 04:28 AM
  5. Replies: 4
    Last Post: 10-08-2012, 03:58 PM
  6. [SOLVED] Trying to Find selected cell content within another worksheet cell range.
    By Craigside in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-13-2012, 04:36 PM
  7. Cell Content and Format to VBA
    By mohitp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2009, 04:11 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