ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Advice on Creating an Excel Formula or Macro - PLEASE HELP!!!! (https://www.excelbanter.com/excel-worksheet-functions/96364-advice-creating-excel-formula-macro-please-help.html)

So Tru Geo

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.


Bearacade

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

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


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=556136



All times are GMT +1. The time now is 06:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com