+ Reply to Thread
Results 1 to 17 of 17

Making a Rule?

Hybrid View

VinnySx Making a Rule? 08-29-2014, 08:59 PM
Tony Valko Re: Making a Rule? 08-29-2014, 09:02 PM
VinnySx Re: Making a Rule? 08-29-2014, 09:32 PM
VinnySx Re: Making a Rule? 08-29-2014, 09:47 PM
Tony Valko Re: Making a Rule? 08-29-2014, 10:34 PM
Vikas_Gautam Re: Making a Rule? 08-29-2014, 10:35 PM
boopathiraja Re: Making a Rule? 08-29-2014, 11:25 PM
VinnySx Re: Making a Rule? 08-30-2014, 07:27 AM
Tony Valko Re: Making a Rule? 08-30-2014, 09:31 AM
VinnySx Re: Making a Rule? 08-30-2014, 09:35 AM
Tony Valko Re: Making a Rule? 08-30-2014, 09:39 AM
VinnySx Re: Making a Rule? 08-30-2014, 09:55 AM
Tony Valko Re: Making a Rule? 08-30-2014, 10:01 AM
VinnySx Re: Making a Rule? 08-30-2014, 10:11 AM
Tony Valko Re: Making a Rule? 08-30-2014, 10:12 AM
VinnySx Re: Making a Rule? 08-30-2014, 10:16 AM
Tony Valko Re: Making a Rule? 08-30-2014, 10:18 AM
  1. #1
    Registered User
    Join Date
    08-10-2014
    Location
    Massachusetts
    MS-Off Ver
    2007
    Posts
    22

    Question Making a Rule?

    Hi Everyone

    What I am trying to do is let say if B6=1 then I want B58:B63 to change color? Can I do this thru Conditional Formatting? If yes could someone please show me how?

    Thank You
    VinnySx

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Making a Rule?

    Like this...

    Select the *entire* range B58:B63 starting from cell B58.
    Cell B58 will be the active cell. The active cell is the
    one cell in the selected range that is not shaded. The
    formula will be relative to the active cell.

    Goto the Home tab>Styles>Conditional Formatting>
    Manage rules>New rule>Use a formula to determine
    which cells to format

    Enter this formula in the box below:

    =B$6=1

    Click the Format button
    Select the desired style(s)
    OK out
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    08-10-2014
    Location
    Massachusetts
    MS-Off Ver
    2007
    Posts
    22

    Re: Making a Rule?

    Hi Tony

    THANK YOU that rule well just RULES lol....

    Thank You

  4. #4
    Registered User
    Join Date
    08-10-2014
    Location
    Massachusetts
    MS-Off Ver
    2007
    Posts
    22

    Re: Making a Rule?

    Hi Tony

    Question hope you can answer this one very similar to the last question! Lets say I click on C11 regardless of the value just the act of choosing the cell then I would like A11 to change color. Could this be done with a rule?

    Thank You
    Vinny

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Making a Rule?

    You would need an event macro for this.

    Tell us the EXACT range of cells that you want this to apply to and what color do you want to use?

    I'm not much of a programmer but I think I can handle this.

  6. #6
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Making a Rule?

    For the last question.. Try this..

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Address = Range("A11").Address Then
    Target.Interior.ColorIndex = 4
    End If
    End Sub
    Copy this code and Press Alt + F11 then click "sheet1" on the tree structure on the left hand side..
    the paste the code there...
    now if you select the cell A11, the cell color will change to green..

    you can change the color by changing the color index no in the code..provided..
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  7. #7
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Making a Rule?

    Try the below formula in conditional format, open the attachment select b6 and f2 and enter


    =CELL("ADDRESS")="$B$6"
    Attached Files Attached Files
    Click just below left if it helps, Boo?ath?

  8. #8
    Registered User
    Join Date
    08-10-2014
    Location
    Massachusetts
    MS-Off Ver
    2007
    Posts
    22

    Re: Making a Rule?

    Hi
    Vikas I tried what you said however it didn't work I may have done something wrong. boopathiraja that's not what I wanted to happen?
    OK let try again, here is one area then I should be able to transpose to the rest of the cell. If you click on cell B4 I would like cell A4 to change color Tony gave me a rule and it worked great however I gave Tony a value, in this scenario I would like to have the rule work just on choosing the cell? Can this be done on a rule??

    THANK YOU EVERYONE FOR THE HELP
    Vinny

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Making a Rule?

    You need an event macro.

    I'm not much of a programmer but this works for me.

    Assuming you want to select a cell in the range B2:B10 and have the corresponding cell in A2:A10 fill color change to yellow.

    Select the sheet where you want this to happen
    Right click the sheet tab and select View code

    This will open the VB editor

    Copy the code below and paste it into the right side of the window that opens.

    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
            With Target
                If .Count > 1 Then Exit Sub
                If Not Intersect(Range("B2:B10"), .Cells) Is Nothing Then
                    Application.EnableEvents = False
                    .Offset(0, -1).Interior.ColorIndex = 6
                End If
                    Application.EnableEvents = True
             End With
    End Sub
    Close the VB editor to return to Excel

    Try it out

  10. #10
    Registered User
    Join Date
    08-10-2014
    Location
    Massachusetts
    MS-Off Ver
    2007
    Posts
    22

    Re: Making a Rule?

    Hi Tony

    Thank You for the reply, I will give this a try. Question the first rule you gave me worked great, however the rule worked with a specified value there's no way to substitute that specified value for a mouse click? just asking...

    Vinny

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Making a Rule?

    Not sure I understand.

    You can select a cell with your mouse, which is a mouse click, and have the cell fill color change.

  12. #12
    Registered User
    Join Date
    08-10-2014
    Location
    Massachusetts
    MS-Off Ver
    2007
    Posts
    22

    Re: Making a Rule?

    Hi Tony

    YES that is correct. ok let say I click on cell B4 I would like cell A4 to change color! You gave me a very simple rule in the beginning however it needed a value to change color state I would like instead of a Value just a mouse click to change the color state is this possible in a rule? As far as the Private Sub Sheet lol I don't fair very well.

    Vinny

  13. #13
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Making a Rule?

    Can you be more specific?

    It sounds like you simply want to select a cell in some range and when selected, have that cell fill color change.

    Is that what you want to do? Tell us the EXACT range that this should apply to.

    This can not be done using conditional formatting. You have to use an event macro.

  14. #14
    Registered User
    Join Date
    08-10-2014
    Location
    Massachusetts
    MS-Off Ver
    2007
    Posts
    22

    Re: Making a Rule?

    Hi Tony

    If that is the case I'm not good with event macro's. But just to make sure were on the same page you gave me this earlier =B$6=1 that rule worked great, now can I replace =B$6=1 with =B$6=mouse click that is what I'm getting at is that possible without the event macro??

    Vinny

  15. #15
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Making a Rule?

    Short answer, no.

  16. #16
    Registered User
    Join Date
    08-10-2014
    Location
    Massachusetts
    MS-Off Ver
    2007
    Posts
    22

    Re: Making a Rule?

    Hi Tony

    OK THANK YOU SO MUCH for your VALUBULE HELP you have been very patient with me on this again thank you....

    Vinny

  17. #17
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Making a Rule?

    You're welcome!

    Good luck!

+ 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] Making Rule work on Select Columns
    By shba in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-28-2013, 12:59 PM
  2. rule to turn off a rule
    By tiger10012 in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 02-13-2013, 12:44 PM
  3. AND IF OR rule
    By bibekpd in forum Excel General
    Replies: 5
    Last Post: 11-10-2010, 02:53 PM
  4. making a spreadsheet for student coursework making
    By spartan11chin in forum Excel General
    Replies: 17
    Last Post: 12-01-2009, 08:18 AM
  5. rule of 78?
    By aceee in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-03-2008, 08:25 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