#3
|
||||
|
||||
Ich wusste gar nicht, daß Basic schon damals Konstrukte mit 'with' verstand.
Hier mal ein Beispiel zur Verwendung in VBA (Visual Basic for Applications): Code:
With Sheets("resultdb") newcode = .Cells(C, 1).Value newtype = .Cells(C, 6).Value newcomm1 = .Cells(C, 7).Value newcomm2 = .Cells(C, 8).Value newcomm3 = .Cells(C, 9).Value End With Bei Benutzung von 'with' wird ein Objekt referenziert und alles innerhalb des Konstrukts kann ab da ohne das vorangestellte Objekt angesprochen werden. Ich könnte also alternativ, ohne 'with' schreiben: Code:
newcode = Sheets("resultdb").Cells(C, 1).Value newtype = Sheets("resultdb").Cells(C, 6).Value newcomm1 = Sheets("resultdb").Cells(C, 7).Value newcomm2 = Sheets("resultdb").Cells(C, 8).Value newcomm3 = Sheets("resultdb").Cells(C, 9).Value
__________________
Zitat:
|