anrion
Goto Top

WorksheetFunction in anderem Blatt

Hallo Leute,

ich habe folgendes Problem:

With Worksheets("Kalender")  
gittplt = WorksheetFunction.Sum(Range(Cells(3, rittplt), Cells(3, (cittplt - 1))))
End With

Dieser Code steht in einem Makro in Modul 1. Führe ich es aus, passiert nichts mit dem g.

Es soll aus dem Blatt Kalender auf die Zellen zugegriffen werden und hieraus die Summe gebildet werden.
rittplt und cittplt sind Variablen im Makro, welche die Spalte beschreiben (r z.B. 3 und c z.B. 5 - 1 -> Somit Summe aller Zahlen von Spalte 3 bis 4 in den Zeilen 3)

Lg Stefan

Content-Key: 312855

Url: https://administrator.de/contentid/312855

Printed on: April 26, 2024 at 04:04 o'clock

Mitglied: 129813
Solution 129813 Aug 17, 2016 updated at 11:35:45 (UTC)
Goto Top
You did not define which cells from which worksheet, only the With statement is not enough you need to add the points for the properties .Range() and .Cells() face-wink
With Worksheets("Kalender")  
    gittplt = WorksheetFunction.Sum(.Range(.Cells(3, rittplt), .Cells(3, (cittplt - 1))))
End With
Regards
Member: AndreasHoster
AndreasHoster Aug 17, 2016 updated at 11:38:11 (UTC)
Goto Top
highload ist zu schnell.
Member: Anrion
Anrion Aug 17, 2016 at 11:51:45 (UTC)
Goto Top
Thanks highload helps me a lot! face-smile