View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
KL[_5_] KL[_5_] is offline
external usenet poster
 
Posts: 49
Default Dynamic Arrays and Formulae

Joseph,

Try this one:

Sub SumWorkbooks()
Dim MyCell As Range
Dim wb As Workbook
Dim MyFormula As String
Set MyCell = ThisWorkbook.Sheets("Reports").Range("B2")

For Each wb In Workbooks
If wb.Name < ThisWorkbook.Name Then
MyFormula = MyFormula & "'" & wb.Name & "'" & "!R2C2" & ","
End If
Next wb
MyCell.FormulaR1C1 = "=SUM(" & Left(MyFormula, Len(MyFormula) - 1) & ")"
End Sub

Regards,
KL

"Joseph" wrote in message
...

Anyone? Still pulling my hair out here.

Cheers


--
Joseph


------------------------------------------------------------------------
Joseph's Profile:
http://www.excelforum.com/member.php...fo&userid=5637
View this thread: http://www.excelforum.com/showthread...hreadid=313874