+ Reply to Thread
Results 1 to 9 of 9

Macro for Conditional formatting of a column based on another column

  1. #1
    Registered User
    Join Date
    09-24-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    6

    Macro for Conditional formatting of a column based on another column

    Hi All,

    I am totally new to Macros. I need a Macro which should format a column based on the value of another column.
    Consider I have 10 rows. I have to format column D, based on the value of Column E. If the value of Column E is > 1000, then the background color of Column D should be changed as green. After performing this formatting, the value in Column E should be hidden.

    Is this possible? Can anyone help please.

    Thanks !!

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Macro for Conditional formatting of a column based on another column

    Hi

    Why fo you want to do this with a macro? No need of this. You can use Conditional Formatting for this.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    09-24-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Macro for Conditional formatting of a column based on another column

    The Column E should not be visible. Thats why I thought of going for macros.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Macro for Conditional formatting of a column based on another column

    Take a look to the example and let us know if this is what you need.

    =E2>1000 Is the formula in CF rules.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-24-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Macro for Conditional formatting of a column based on another column

    Thanks for the Quick Reply, I too tried making the font color white, but when the excel sheet is selected using Select All or Ctrl + A, the white color data could be seen in the sheet. I should not show these values in the Sheet , is there any possibility to make them invisible in sheet? Also when we click those white color data, it shows up in formula bar. I must be able to hide the data from formula bar too. Any possibility?

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Macro for Conditional formatting of a column based on another column

    So when in any cell of the range E2:E10 exists a number>1000, you need the whole column to be hidden?

  7. #7
    Registered User
    Join Date
    09-24-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Macro for Conditional formatting of a column based on another column

    Ya the entire column has to be hidden.

    Can we have a macro which would first perform the conditional formatting of Column D using Column E's value and then clear the contents of Column E. Is this possible?

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Macro for Conditional formatting of a column based on another column

    Ok. Then you need VBA for this and my vba skills are not good.

    I am sure that someone else will be able to offer you something much better. In the mean time just to play around see this recorded macro.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-24-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Macro for Conditional formatting of a column based on another column

    That is a good work around, Thanks much for your quick replies.. But actual requirement is to make the column E invisible. Lets c if someone else is able to help me solve it.

    Thank u

+ 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. Replies: 5
    Last Post: 09-24-2012, 05:14 PM
  2. Conditional Formatting based on 2 column data
    By tobbrack in forum Excel General
    Replies: 3
    Last Post: 10-01-2011, 08:27 AM
  3. Replies: 3
    Last Post: 10-29-2010, 12:52 AM
  4. Replies: 2
    Last Post: 06-02-2010, 02:34 PM
  5. conditional formatting based on column
    By snax500 in forum Excel General
    Replies: 4
    Last Post: 04-27-2005, 02:06 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