+ Reply to Thread
Results 1 to 9 of 9

Can I copy color with an equals sign?

Hybrid View

  1. #1
    Registered User
    Join Date
    03-03-2007
    Posts
    37

    Can I copy color with an equals sign?

    If I have a cell B5 that contains: =A1
    This puts the value of A1 into B5.
    If A1 is red, can I make B5 copy that redness? Is there an easy way to make it copy the color or format, not just the value, using a function? I can't find this in my excel manual.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    No you can not
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Registered User
    Join Date
    03-03-2007
    Posts
    37

    can a cell look at input and change color?

    Is there a way for cell to change color when it gets a certain input,
    sort of like =if(x=5,turn red, don't change)?

  4. #4
    Registered User
    Join Date
    12-06-2006
    Location
    Canada
    Posts
    18
    Try Conditional Formatting as a Formatting Tool within Excel.

    Format>Conditional Formatting...

    Enter your values (ie 5 ... from your example) and then click on the Format button (bottom right) and you will be able to change background to red and text to bold-black or white. Whatever colour scheme works for you.

    I've used this lots when I need to highlight lines that are, for example, below 10% or over 90% with different colors, and other things too...

    Hope this helps.

    CHA Stats

  5. #5
    Registered User
    Join Date
    03-03-2007
    Posts
    37

    how to trick funtion into pulling in color with value

    I had so much fun playing with conditional formating, forgot to say thanks MUDRAKER & CHA Stats.

    Still trying to trick it (cell-C) into acting like a function that pulls in the color with the value.

    Best I can do is get the cell next to cell-C to pull in the color by using to duplicate cells with conditional formatting and cell-B looking at the value of cell-A. Cell-B has the font color change with backround color so that value is invisible. Problem is you only have 3 choices?

  6. #6
    Forum Contributor
    Join Date
    02-28-2006
    Posts
    690
    there is a way to have unlimited conditional formatting, at least 20, it is a bit of code in these archives i think, but google it.

  7. #7
    Registered User
    Join Date
    03-03-2007
    Posts
    37

    macro triggered by value?

    thanks, How about a value that triggers a macro that goes and gets the format in question puts it in the correct cell. Can I do that if I dig into macros more?

    I haven't played with macros enough to know but it sounds like a security issue. (hmm, date/time triggers macro and excel macro takes over computer which takes over the internet which takes over the world and ... ?)

  8. #8
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    You could use a sheet change event macro

    To install macro to correct location

    Copy this macro
    GoTo Excel
    Select sheet this is to appy to
    Right Click on Sheet Name Tab > select View Code
    Paste macro into the Worksheet Module displayed

    example of worksheet change macro
    This example works only on cells a1 & b1
    Private Sub Worksheet_Change(ByVal Target As Range)
       Dim Rng As Range
    
       For Each Rng In Target
          If Not Application.Intersect(Rng, Range("a1:b1")) Is Nothing Then
             Application.EnableEvents = False
             With Rng.Interior
                .Pattern = xlSolid
                Select Case Rng.Value
                Case 5
                   .ColorIndex = 3
                Case 4
                   .ColorIndex = 6
                Case Else
                   .ColorIndex = xlNone
                End Select
             End With
          End If
       Next Rng
       Application.EnableEvents = True
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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