Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formula with arrays


I would like to make a formula that in the same range, consider only the
cells where the color font is red and acumulate those values. I I wrote
this formula below, but it is not working: *PLEASE HELP!!*

Function BestPrice(MySelection1 As Range, MySelection2 As Range) As
Variant
Dim v1, v2, T As Variant
v2 = MySelection2.Font.ColorIndex
v1 = MySelection1.Value
T = 0
For i = 1 To UBound(v1, 1)
If v2(i, 1) = 3 Then
T = T + v1(i, 1)
Else
T = T
End If
Next
BestPrice = T
End Function


--
eamendes
------------------------------------------------------------------------
eamendes's Profile: http://www.excelforum.com/member.php...o&userid=32176
View this thread: http://www.excelforum.com/showthread...hreadid=519239

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Formula with arrays

Hi E,

See xlDynamic's Colour functions page at:

http://www.xldynamic.com/source/xld.....html#counting


---
Regards,
Norman



"eamendes" wrote in
message ...

I would like to make a formula that in the same range, consider only the
cells where the color font is red and acumulate those values. I I wrote
this formula below, but it is not working: *PLEASE HELP!!*

Function BestPrice(MySelection1 As Range, MySelection2 As Range) As
Variant
Dim v1, v2, T As Variant
v2 = MySelection2.Font.ColorIndex
v1 = MySelection1.Value
T = 0
For i = 1 To UBound(v1, 1)
If v2(i, 1) = 3 Then
T = T + v1(i, 1)
Else
T = T
End If
Next
BestPrice = T
End Function


--
eamendes
------------------------------------------------------------------------
eamendes's Profile:
http://www.excelforum.com/member.php...o&userid=32176
View this thread: http://www.excelforum.com/showthread...hreadid=519239



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Write a formula using two arrays, across two worksheets Susan Excel Worksheet Functions 11 July 29th 08 05:30 PM
Arrays/Functions/Different datatypes in a formula? Jess Excel Worksheet Functions 3 November 13th 06 10:15 AM
Using Vlookup in formula arrays BartDesc Excel Worksheet Functions 4 July 3rd 05 04:42 PM
=sum formula using arrays John[_64_] Excel Programming 1 July 13th 04 04:36 PM
formula question for arrays Cynthia Gregory Excel Programming 2 June 18th 04 08:32 PM


All times are GMT +1. The time now is 07:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"