sich selbst erweiternde Tabellen in Excel?
Ich habe folgendes Problem: In meiner Exceldatei habe ich mehrere Folien mit unterschiedlichen Projekten, bei denen immer der Inhalt von Zelle G20 relevant ist. Jetzt habe ich mir eine Tabelle in einer Art Inhaltsfolie erstellt, die alle Zellen G20 aus den jeweiligen Folien/Projekten enthält. Soweit so gut, aber ich möchte, dass die Tabelle in dieser "Inhaltsfolie"- automatisch erkennt, wenn ich ein neues Projekt einfüge und dann eine neue Spalte mit der Zelle G20 des neuen Projekts erstellt. Es soll sich also pro neuer Folie/Projekt eine neue Spalte mit Zelle G20 des neuen Projekts in der Inhaltsfolie bilden. Hoffe das ist verständlich und einer kann mir helfen.
Danke schon mal in voraus
1 Antwort
Vom Beitragsersteller als hilfreich ausgezeichnet
Mir fällt nur ein Weg per VBA ein.
Sub UpdateInhaltsfolie()
Dim wsInhalt As Worksheet
Dim ws As Worksheet
Dim LastColumn As Long
Dim i As Long
Set wsInhalt = ThisWorkbook.Sheets("Inhaltsfolie")
LastColumn = wsInhalt.Cells(1, wsInhalt.Columns.Count).End(xlToLeft).Column
For Each ws In ThisWorkbook.Sheets
If ws.Name <> "Inhaltsfolie" Then
For i = 1 To LastColumn
If wsInhalt.Cells(1, i).Value = ws.Name Then Exit For
Next i
If i > LastColumn Then
LastColumn = LastColumn + 1
wsInhalt.Cells(1, LastColumn).Value = ws.Name
wsInhalt.Cells(2, LastColumn).Formula = "='" & ws.Name & "'!G20"
End If
End If
Next ws
End Sub
Dankeschön :), hatte gehofft es gibt auch einen Weg ohne VBA.