Gruppe
Funktion
Problem
Es sollen die Werte aus jeder 20. Zeile ermittelt werden.
StandardModule: Modul1
Sub SetSum()
Dim dValue As Double
Dim iCounter As Integer
Dim sFormula As String, sPath As String
sPath = Range("B1").Value
If Right(sPath, 1) <> "\" Then
sPath = sPath & "\"
End If
For iCounter = Range("B2").Value To Range("B3").Value
sFormula = "'" & sPath
sFormula = sFormula & "[" & iCounter & ".xls" & "]"
sFormula = sFormula & Range("B4").Value & "'!"
sFormula = sFormula & Range("B5").Value
Range("C1").Formula = "=" & sFormula
dValue = dValue + Range("C1").Value
Next iCounter
Range("C1").ClearContents
Range("B6").Value = dValue
End Sub