+ Reply to Thread
Results 1 to 2 of 2

Advice on Creating an Excel Formula or Macro - PLEASE HELP!!!!

  1. #1
    So Tru Geo
    Guest

    Advice on Creating an Excel Formula or Macro - PLEASE HELP!!!!

    In Excel 2000 - I need to create a formula or macro that will pull values,
    from a column, based on color (or text if color won't work). Conditional
    formatting will color a cell based on a condition but I need to be able to
    define a condition based on either color. For example, a specific color is
    in cell a1, a3, & a5 the value is in a2, a4, & a6. I need to create a formula
    or macro in cell a7 that will add the values from a2, a4, & a6 based on the
    condition (color) in cell a1, a3, & a5.


  2. #2
    Forum Contributor
    Join Date
    06-01-2006
    Posts
    324
    This is very crude, I hope it helps.

    I use the light yellow color as base, change as needed



    Sub Macro1()

    Dim temp As Integer

    If Range("A1").Interior.ColorIndex = 36 Then temp = temp + Range("A2").Value

    If Range("A3").Interior.ColorIndex = 36 Then temp = temp + Range("A4").Value

    If Range("A5").Interior.ColorIndex = 36 Then temp = temp + Range("A6").Value

    Range("A7") = temp

    End Sub
    Google is your best friend!

+ 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