+ Reply to Thread
Results 1 to 7 of 7

Highlight cells in column of found text string - Rework

  1. #1
    Forum Contributor delaing's Avatar
    Join Date
    07-16-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    192

    Highlight cells in column of found text string - Rework

    In a previous post, my request was provided and implemented, thus labeled "Solved".
    http://www.excelforum.com/showthread...t=#post4187076

    Not sure why, but now I'm getting unwanted results.

    Goal: Highlight, with yellow, the cells in the column with the column heading "ACCT #" - below the label and not above it, nor in an area outside of the pertinent data table.

    Attached is an xlsx showing the BAD results of the code and with the two areas that are being highlighted but not desired. Then one showing Good results of the highlighting. I do see one difference being that the cells above "ACCT #" are empty in this one, but need it to work if there is data above the Column label as in the bad highlight example, if possible.

    Here is the section of code that does the work:
    Please Login or Register  to view this content.
    This is indeed part of a larger module and I can insert that also, but there is a lot to weed through that shouldn't be impacting this.

    Let me know where I need to clarify in this request.

    Thank you,
    Delain
    Attached Files Attached Files

  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,969

    Re: Highlight cells in column of found text string - Rework

    You have uploaded .xlsx files, they cannot (wont) contain VBA. Excel must have it's settings updated to allow VBA, or else teh code is stripped out when the file is saved. Are you sure that you (a) uploaded the correct file/s, or (b) that the code was actually saved with the file - ie, you saved and the code did not save with the file, and is therefor now not even there to work?

    (also, unless you are applying CF to a LARGE range, why do you need VBA for this?
    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
    Forum Contributor delaing's Avatar
    Join Date
    07-16-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    192

    Re: Highlight cells in column of found text string - Rework

    Thanks for your interest in this.

    I don't understand
    . . .they cannot (wont) contain VBA. Excel must have it's settings updated to allow VBA . . .
    But then you're asking me if I uploaded a file with the VBA code contained in the file. I'm confused on that point.

    The sheet I attached does not contain any code; it shows the needed result, after the code runs, except for the areas I don't want highlighted. The code resides in my personal.xlsm file where 95% of my code lives. I run this particular code from a macro button on the Ribbon.
    I inserted the code, in my post, that does the highlighting and mentioned that I could insert the larger module if someone really thought it was critical.

    CF, of course is a good thought, but I'm not using CF in this instance as I don't want it active in all of these worksheets. The highlighting is a special application after a copy of my worksheet is copied out of the primary workbook, given a new name, and the highlighting covers the accounts I am directing a team of assistants to deal with.
    Works great, except in instances where there is text/data in the cells above the column header as shown in the original post.

    Help me understand how I could have made my original request more clear as I don't want to confuse this process.

    Thank you,
    Delain

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Highlight cells in column of found text string - Rework

    This should sort you out:

    Please Login or Register  to view this content.
    If you are happy with my response please click the * in the lower left of my post.

  5. #5
    Forum Contributor delaing's Avatar
    Join Date
    07-16-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    192

    Re: Highlight cells in column of found text string - Rework

    Exactly what I needed; beautiful!

    One of my biggest weaknesses with Excel VBA, regarding basics that I should know by now, is coding Range areas for Selecting and applying actions, formats, extracting data, etc..
    I have read various articles and how-to's across the Internet. But, do you have a recommendation for a good source to learn this from?
    My VBA understanding is cobbled ( I call it.) from deciphering code like yours and others, along with the how-to explanations. Needing to maintain production with my job is a tough balance with being able to invest more time in taking a course or such.

    Thanks for your help. Seemed no one else wanted to touch this one.

    Delain

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Highlight cells in column of found text string - Rework

    In my opinion excel is one of those "Learn by Doing" kind of things. If you are wanting to take your skills to the next level you should start trying to answer questions on the forums and then compare your answers to others to see where your code could improve.

  7. #7
    Forum Contributor delaing's Avatar
    Join Date
    07-16-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    192

    Re: Highlight cells in column of found text string - Rework

    Good thought.

+ 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] Highlight cells in column of found text string
    By delaing in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 09-11-2015, 02:15 PM
  2. Replies: 2
    Last Post: 04-17-2014, 03:30 PM
  3. [SOLVED] IF range of cells contains string of text, return contents of cell where string is found
    By nobodyukno in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-03-2013, 09:56 AM
  4. Replies: 3
    Last Post: 10-25-2012, 12:49 AM
  5. highlight a row when text found
    By Tortus in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-20-2012, 07:36 AM
  6. Replies: 1
    Last Post: 09-19-2009, 08:09 PM
  7. [SOLVED] Search column - return row found in long text string
    By JayL in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2005, 12:06 AM

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