Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. REM  *****  BASIC  *****
  2.  
  3. Sub MAIN
  4.     Dim oCell1 As Object, oCell2 As Object, oCell3 As Object
  5.     Dim oSheet As Object
  6.     Dim x As Integer, i As Integer
  7.     x = 2
  8.    
  9.     oSheet = ThisComponent.Sheets(0)
  10.     For i = 0 to 400
  11.         oCell1 = oSheet.getCellByPosition(0, i)
  12.         oCell2 = oSheet.getCellByPosition(1, i)
  13.         oCell3 = oSheet.getCellByPosition(2 + x, i)
  14.         oCell1.Value = i + 2000
  15.         oCell2.Value = x
  16.         oCell3.Value = x
  17.         oSheet.getCellByPosition(2 + x, 401).Value = oSheet.getCellByPosition(2 + x, 401).Value + 1
  18.         If ((i + 1) mod 4 = 0) AND (((i + 1) mod 100 <> 0) OR ((i +1) mod 400 = 0)) Then
  19.             x = (x + 2) mod 7
  20.         Else
  21.             x = (x + 1) mod 7
  22.         End If
  23.     NEXT i
  24. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement