+ Reply to Thread
Results 1 to 9 of 9

2010 Conditional Formatting Help

  1. #1
    Registered User
    Join Date
    04-26-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    1

    2010 Conditional Formatting Help

    Please can someone advise how I do the following in excel 2010.
    I have a row with 10 cells, and 1000 rows altogether.
    I would like the whole row to be filled purple if the first cell in the row =2. I can do this individually but dont want to have to do this 1000 times, so tried pasting the format.

    when I tried to special paste the format to the other 999 rows I cannot get it to work exactly the same as the range it applies to seems to change.

    I'm quite new to excel 2010 so an idiots guide is required

    Many thanks

    Ben

  2. #2
    Registered User
    Join Date
    04-26-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: 2010 Conditional Formatting Help

    1. Click on the developer tab in the menu bar
    2. Click on the drop-down arrow below insert
    3. Select the rectangular command button from the ActiveX controls
    4. Select a convenient location and then click and drag the mouse button to draw a command button
    5. Double click on the command button
    6. Between the 2 lines of code that you will see in the Visual Basic Editor (VBE) Window just copy and paste the following code:
    Please Login or Register  to view this content.
    7. Now close the VBE window and come back to your Excel worksheet
    8. Click on the developer tab in the menu bar
    9. Click on 'Design' to exit the design mode
    10. Now click on the Command Button1
    11. The relevant row will be highlighted purple and if the first cells values are 2 then the font of the value 2 will become white
    Last edited by arlu1201; 04-26-2014 at 08:48 AM.

  3. #3
    Registered User
    Join Date
    04-26-2014
    Location
    Detroit, Michigan, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: 2010 Conditional Formatting Help

    I have a different problem. I have a column of cells that are greater than, less than or equal to, the cell preceding it. So, for instance, cell AG5 is >, <, = to AF5. In this workbook it is less than. I want to format the cells based on the value of the preceding cell. Red if it is less than, green if it greater than and blue if it is equal to. Is this possible. Thank you. Tom

  4. #4
    Registered User
    Join Date
    04-26-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: 2010 Conditional Formatting Help

    Again insert a command button and give it the caption 'color values'. Now double click on the command button and use the following code to color the values accordingly:
    Dim i As Integer
    For i = 1 To 3
    If Cells(i, 32).Value = Cells(i, 33).Value Then
    Cells(i, 32).Font.ColorIndex = 5
    ElseIf Cells(i, 32).Value < Cells(i, 33).Value Then
    Cells(i, 32).Font.ColorIndex = 3
    ElseIf Cells(i, 32).Value > Cells(i, 33).Value Then
    Cells(i, 32).Font.ColorIndex = 4
    End If
    Next i

    I've assumed that you have data in 3 rows. If you have more rows of data then change the value of 3 to whatever your requirement is.
    To get the color indices visit this website: http://dmcritchie.mvps.org/excel/colors.htm

  5. #5
    Registered User
    Join Date
    04-26-2014
    Location
    Detroit, Michigan, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: 2010 Conditional Formatting Help

    Thanks for the help. Now I am a lot closer, but the command is asking me to debug and nothing happens. I could not caption the command to "Color Values" I have attached a screen shot, please help me the rest of the way. Thank you very much, Tom.
    Attached Images Attached Images

  6. #6
    Registered User
    Join Date
    04-26-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: 2010 Conditional Formatting Help

    Have a look at my code again. Instead of ag and af, you should use i.
    For changing the caption, right-click on the button - select properties and against the item Caption in the new window (properties) that pops up, just write your caption, eg. color values.

  7. #7
    Registered User
    Join Date
    04-26-2014
    Location
    Detroit, Michigan, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: 2010 Conditional Formatting Help

    Thanks for the update D! One more question: if I have 14 rows and subsequent columns such as: ah, ai, aj, ak, etc. do i need to do anything to the code? Thanks for your help, Tom.

  8. #8
    Registered User
    Join Date
    04-26-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: 2010 Conditional Formatting Help

    Just change the for loop to:
    for i = 1 to 14
    If you have headers in row 1 then change the for loop to:
    for i= 2 to 15
    You don't need to change anything else.

  9. #9
    Registered User
    Join Date
    04-26-2014
    Location
    Detroit, Michigan, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: 2010 Conditional Formatting Help

    dktakyar - thank you for your help, but I am doing something wrong. I modified the code to your instructions, but I get the wrong column changing colors. Please help me one more time. Thank you so very much.

    Tom

+ 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. Conditional Formatting Excel 2010
    By bsanjay in forum Excel General
    Replies: 1
    Last Post: 02-19-2013, 09:07 AM
  2. Delete Conditional Formatting conditions but keep cell formatting - Excel 2010
    By tetreama in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2012, 08:28 PM
  3. Conditional Formatting in Excel 2010
    By Thenesh in forum Excel General
    Replies: 6
    Last Post: 05-21-2012, 08:32 PM
  4. Conditional Formatting in Excel 2010
    By goldenclick in forum Excel General
    Replies: 1
    Last Post: 06-03-2011, 02:41 AM
  5. Conditional formatting using keywords, 2010
    By rknapp in forum Excel General
    Replies: 2
    Last Post: 11-17-2010, 05:07 PM

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