Hallo Zusammen,
ich möchte die Formel: =Sum(range) durch eine Makroprogrammierung ersetzten.
Dabei soll der Wert in der Zelle, die den definierten Bereich summiert bei Änderungen automatisch angepasst werden, sprich so, wie dies bei der Excel-Funktion "=sum" üblich ist.
Das ganze habe ich schon über die Makroaufzeichnung hinbekommen:
Sub SummenBildung()
Range("E45).Select
ActiveCell.FormulaR1C1 = "=SUM(R[-8]C:R[-2]C)"
End Sub
...jedoch erscheint, wenn ich auf die Zelle klicke, die diese Summe summiert (E45), dann immer noch die Formel, was ich nicht unbedingt möchte. Weiß jemand ob sowas auch mit folgender oder anderer Funktion geht:
Sub SummenBildung()
Range("e45") = Application.WorksheetFunction.Sum("e37:e43")
Range("e45") = Application.Volatile
End Sub
Dabei ist die dynamische Anpassung sehr wichtig, da sich Zahlenwerte ja ändern können.
Vielen Dank im Voraus
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
Thread moved to Non-English Forum
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks