Auch in aktuellen Versionen kommen wir immer wieder an unsere Grenzen wenn es um die maximale Datensatzgröße in Tabellen geht.
Diese zwei VBA-Funktionen helfen mir im Excel die aktuelle Größe einer Tabelle zu bestimmen.
Option Explicit Function CalculateSize(ByVal FieldClass As String, ByVal FieldType As String, ByVal FieldLength As Integer) Dim FieldSize As Single If FieldClass <> "Normal" Then CalculateSize = 0 Exit Function End If Select Case FieldType Case "Option", "Integer", "Boolean" FieldSize = 4 Case "BigInteger", "Date", "DateTime", "Duration", "Time", "BLOB" FieldSize = 8 Case "Decimal" FieldSize = 12 Case "DateFormula" FieldSize = 32 Case "GUID" FieldSize = 16 Case "Code" FieldSize = ((FieldLength + 1) * 2) + 1 Case "Text" FieldSize = (FieldLength + 1) * 2 Case Else FieldSize = 0 End Select CalculateSize = FieldSize End Function Function CalculateSizeClassic(ByVal FieldClass As String, ByVal FieldType As String, ByVal FieldLength As Integer) Dim FieldSize As Single If FieldClass <> "Normal" Then CalculateSizeClassic = 0 Exit Function End If Select Case FieldType Case "Option", "Integer", "Boolean", "Date", "Time" FieldSize = 4 Case "BigInteger", "DateTime", "Duration", "BLOB" FieldSize = 8 Case "Decimal" FieldSize = 12 Case "DateFormula" FieldSize = 32 Case "GUID" FieldSize = 16 Case "Code" FieldSize = WorksheetFunction.Ceiling((FieldLength + 2), 4) Case "Text" FieldSize = WorksheetFunction.Ceiling((FieldLength + 1), 4) Case Else FieldSize = 0 End Select CalculateSizeClassic = FieldSize End Function