- Registriert
- 14.05.23
- Beiträge
- 1
Hallo,
Ich habe bei Microsoft Excel folgenden Code, der ich gerne unter MacOS laufen lassen möchte.
Kann mir jemand weiterhelfen, was ich beim Mac ändern, anpassen... muss ?
Herzlichen Dank für die Unterstützung
Sub Kalender_aufbauen()
Dim vKalendertabelle, vDrillDown, vKalender, vKalender2
Dim iKalendertabelle&, iKalender&, jKalender&, iDrillDown&
Dim oKalender As Object, oDrillDown As Object
Set oKalender = VBA.CreateObject("Scripting.Dictionary")
Set oDrillDown = VBA.CreateObject("Scripting.Dictionary")
'Kalendertabelle einlesen
vKalendertabelle = t08_kalendertabelle.Range("A2:G2001")
For iKalendertabelle = LBound(vKalendertabelle, 1) To UBound(vKalendertabelle, 1)
If vKalendertabelle(iKalendertabelle, 1) <> "" And IsDate(vKalendertabelle(iKalendertabelle, 1)) Then
oKalender(vKalendertabelle(iKalendertabelle, 1) & "|" & vKalendertabelle(iKalendertabelle, 2)) = oKalender(vKalendertabelle(iKalendertabelle, 1) & "|" & vKalendertabelle(iKalendertabelle, 2)) + 1
oDrillDown(vKalendertabelle(iKalendertabelle, 2)) = 1
End If
Next
t07_kalender.Range("K18:BU96").ClearContents
'Drilldown-Felder unique darstellen
vDrillDown = oDrillDown.Keys
For iDrillDown = LBound(vDrillDown, 1) To UBound(vDrillDown, 1)
t07_kalender.Cells(iDrillDown * 2 + 18, 11).Value = vDrillDown(iDrillDown)
Next
iDrillDown = iDrillDown - 1
t07_kalender.Rows(18 & ":" & iDrillDown * 2 + 18).Hidden = False
iDrillDown = iDrillDown + 1
t07_kalender.Rows(iDrillDown * 2 + 18 & ":" & 100).Hidden = True
'Kalender gefüllt
vKalender = t07_kalender.Range("K15:BU96")
For iKalender = LBound(vKalender, 1) To UBound(vKalender, 1)
For jKalender = LBound(vKalender, 2) To UBound(vKalender, 2)
If oKalender.Exists(vKalender(1, jKalender) & "|" & vKalender(iKalender, 1)) Then
vKalender(iKalender, jKalender) = oKalender(vKalender(1, jKalender) & "|" & vKalender(iKalender, 1))
End If
Next
Next
ReDim vKalender2(1 To UBound(vKalender, 1) - 3, LBound(vKalender, 2) To UBound(vKalender, 2))
For iKalender = 4 To UBound(vKalender, 1)
For jKalender = LBound(vKalender, 2) To UBound(vKalender, 2)
vKalender2(iKalender - 3, jKalender) = vKalender(iKalender, jKalender)
Next
Next
t07_kalender.Range("K18:BU96") = vKalender2
End Sub
Ich habe bei Microsoft Excel folgenden Code, der ich gerne unter MacOS laufen lassen möchte.
Kann mir jemand weiterhelfen, was ich beim Mac ändern, anpassen... muss ?
Herzlichen Dank für die Unterstützung
Sub Kalender_aufbauen()
Dim vKalendertabelle, vDrillDown, vKalender, vKalender2
Dim iKalendertabelle&, iKalender&, jKalender&, iDrillDown&
Dim oKalender As Object, oDrillDown As Object
Set oKalender = VBA.CreateObject("Scripting.Dictionary")
Set oDrillDown = VBA.CreateObject("Scripting.Dictionary")
'Kalendertabelle einlesen
vKalendertabelle = t08_kalendertabelle.Range("A2:G2001")
For iKalendertabelle = LBound(vKalendertabelle, 1) To UBound(vKalendertabelle, 1)
If vKalendertabelle(iKalendertabelle, 1) <> "" And IsDate(vKalendertabelle(iKalendertabelle, 1)) Then
oKalender(vKalendertabelle(iKalendertabelle, 1) & "|" & vKalendertabelle(iKalendertabelle, 2)) = oKalender(vKalendertabelle(iKalendertabelle, 1) & "|" & vKalendertabelle(iKalendertabelle, 2)) + 1
oDrillDown(vKalendertabelle(iKalendertabelle, 2)) = 1
End If
Next
t07_kalender.Range("K18:BU96").ClearContents
'Drilldown-Felder unique darstellen
vDrillDown = oDrillDown.Keys
For iDrillDown = LBound(vDrillDown, 1) To UBound(vDrillDown, 1)
t07_kalender.Cells(iDrillDown * 2 + 18, 11).Value = vDrillDown(iDrillDown)
Next
iDrillDown = iDrillDown - 1
t07_kalender.Rows(18 & ":" & iDrillDown * 2 + 18).Hidden = False
iDrillDown = iDrillDown + 1
t07_kalender.Rows(iDrillDown * 2 + 18 & ":" & 100).Hidden = True
'Kalender gefüllt
vKalender = t07_kalender.Range("K15:BU96")
For iKalender = LBound(vKalender, 1) To UBound(vKalender, 1)
For jKalender = LBound(vKalender, 2) To UBound(vKalender, 2)
If oKalender.Exists(vKalender(1, jKalender) & "|" & vKalender(iKalender, 1)) Then
vKalender(iKalender, jKalender) = oKalender(vKalender(1, jKalender) & "|" & vKalender(iKalender, 1))
End If
Next
Next
ReDim vKalender2(1 To UBound(vKalender, 1) - 3, LBound(vKalender, 2) To UBound(vKalender, 2))
For iKalender = 4 To UBound(vKalender, 1)
For jKalender = LBound(vKalender, 2) To UBound(vKalender, 2)
vKalender2(iKalender - 3, jKalender) = vKalender(iKalender, jKalender)
Next
Next
t07_kalender.Range("K18:BU96") = vKalender2
End Sub