Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Boell Fischer   on Jan 13 In MS Office Category.

  
Question Answered By: Sean Grant   on Jan 13

Showing some un VBA experience there

Hmmmm.... I still like my colour idea...

Function fncCombine(rpCombineRange As Range)

Dim rlCel As Range
Dim slCombined As String
Dim slCallerAddress As String
Dim llColour As Long

' What's the colour of the calling cell?
slCallerAddress = Application.Caller.Address
llColour = Range(slCallerAddress).Font.Color

' Go through the range
' Concatonate all cells  with similar colours.
slCombined = ""
For Each rlCel In rpCombineRange
If rlCel.Font.Color = llColour Then
slCombined = slCombined & rlCel.Value
End If
Next rlCel
fncCombine = slCombined

End Function

Share: 

 

This Question has 11 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on custom Sum function? Or get search suggestion and latest updates.


Tagged: