Quick and dirty:
Code: Alles auswählen
Sub kalenderblatt_auswaehlen
odoc = thisComponent
icount = odoc.sheets().count()
m = month( now ) 'aktueller Monat (1...12)
vm = m-1 'vormonat bug : 0...11
nm = m+1 'nachmonat bug : 2...13
for i = 1 to icount
if i >= vm and i <= nm then
odoc.sheets(i-1).isvisible = true 'Korrektur -1 wg Tabellenindex 0 bis icount-1
if i = m then
odoc.Currentcontroller.select(odoc.sheets(i-1).getcellbyposition(0,0))
end if
else
odoc.sheets(i-1).isvisible = false 'alle anderen ausblenden
end if
next
End Sub
Wenn du noch verrätst in welcher Spalte/Zeile die Datumswerte stehen kann man das auch noch erweitern auf die Selektion des aktuellen Tags.
( Im Code steckt noch Fehler, im Januar und im Dezember läufts vmtl. nicht .. )
Gruß Karo