Merging Cells but have each cell counted in the range of merged c.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to figure out a formula that will count each cell in a range of
merged cells as having the same text as the 1st cell in the range.
 
Gats,

You would need to use a user-defined-function, given below. Copy and paste
the code into a codemodule, and use it like

=mySum(A1:D4)

HTH,
Bernie
MS Excel MVP

Function mySum(inRange As Range) As Double
Dim myCell As Range
Dim myMC As Range
For Each myCell In inRange
For Each myMC In myCell.MergeArea
mySum = mySum + myMC.Value
Next myMC
Next myCell

End Function
 
Back
Top