+ Reply to Thread
Results 1 to 6 of 6

Excel VBA to identify alphabets in excel and highlight cells above it

  1. #1
    Registered User
    Join Date
    06-28-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    5

    Excel VBA to identify alphabets in excel and highlight cells above it

    Hi,
    I have an excel with numeric data in it.

    some cells have alphabets mentioned below them (from A to Z), there can be multiple alphabets in single cell, i want to highlight the cell above that.

    For example if there is R in cell no. S7, i would like to highlight, S6.

    my data tables starts from B7 and its ranges keep on changing (both column and rows).

    I want a macros that can scan the entire excel and highlight the cell with yellow color.

    Thanks in advance!!

    Vicky

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Excel VBA to identify alphabets in excel and highlight cells above it

    No need for a macro, just use conditional formatting.
    Highlight your entire table (I'll assume it is A1:D4).
    Go to conditional formatting and choose New Rule...
    Choose Use a Formula....
    In the rule description type =ISTEXT(A2)
    Hit the Format... button and choose to fill with yellow
    Hit Ok, Ok

    That should do it.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Excel VBA to identify alphabets in excel and highlight cells above it

    Maybe:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-28-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Excel VBA to identify alphabets in excel and highlight cells above it

    Hi John,
    Thanks for the reply.

    This VBA is working perfectly.
    However, i have blanks in my data which is represented by - , this code is also highlighting cells above them, is there any possibility , it does not consider - for highlighting. ( i cannot remove - from data, i require them)

    Also, i also wanted to check the possibility of 1 more macros-



    In the attached excel, in tab 1,
    my data is cut by country, gender, age and income (row 4)
    I have cell reference in row 6.

    if you look at cell N 27 . it is JKL.

    Current macro will highlight N26, is it also possible to highlight K26 L26 and M26 (as per reference in column 6)

    Also, it would be great, if we could use different colours for different groups - country, gender, age , income

    I do not mind, selecting a set of columns and running different macros to give different colours

    Thanks so much for the help

    vicky
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Excel VBA to identify alphabets in excel and highlight cells above it

    You're welcome. Try this, or if you'd prefer different colors then let me know.

    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,573

    Re: Excel VBA to identify alphabets in excel and highlight cells above it

    Try this
    Please Login or Register  to view this content.

+ 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. List of cells in excel which will allow only alphabets!
    By abhiindia123 in forum Excel General
    Replies: 5
    Last Post: 06-29-2013, 11:04 AM
  2. Identify & highlight if all cells in a fixed range are blank
    By heena.singh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-24-2013, 05:57 AM
  3. Replies: 2
    Last Post: 05-27-2012, 06:10 AM
  4. Excel 2007 does not highlight selected cells
    By flacounico in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2009, 08:58 PM
  5. Replies: 1
    Last Post: 07-18-2006, 05:20 PM

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