'===================ABV PROJECT======================
'===================MODULE 1  =======================
Sub main ()
'you can edit this macro to execute any command when loading this workbook
'next line call the routine that fill the sheet
call absmain ()
End Sub
sub redraw()
firstdate = cells(4,4)
lastdate = firstdate + 30

for i = 0 to 30
Columns(i+4).ColumnWidth = 2
if i > 0 then
 cells(4,4+i).value = 1+cells(4,3+i)
end if
 for j = 5 to 5+8
  if cells(j,2) <= cells(4,4+i) and cells(j,3) >= cells(4,4+i) then
   cells (j,4+i).Interior.ColorIndex = 10
  else
    cells (j,4+i).Interior.ColorIndex = 40
  end if
 next j
next i
end sub
Sub absmain ()
'Do not edit this macro, changes will not be saved with the workbook!!!
Dim objchart  As Object
Dim objbutton As Object
Worksheets(1).Name = "A"
Worksheets(2).Name = "B"
Worksheets(3).Name = "C"
Worksheets(1).Activate
Columns("D").ColumnWidth = 2.142857
Columns("E").ColumnWidth = 2.142857
Columns("F").ColumnWidth = 2.142857
Columns("G").ColumnWidth = 2.142857
Columns("H").ColumnWidth = 2.142857
Columns("I").ColumnWidth = 2.142857
Columns("J").ColumnWidth = 2.142857
Columns("K").ColumnWidth = 2.142857
Columns("L").ColumnWidth = 2.142857
Columns("M").ColumnWidth = 2.142857
Columns("N").ColumnWidth = 2.142857
Columns("O").ColumnWidth = 2.142857
Columns("P").ColumnWidth = 2.142857
Columns("Q").ColumnWidth = 2.142857
Columns("R").ColumnWidth = 2.142857
Columns("S").ColumnWidth = 2.142857
Columns("T").ColumnWidth = 2.142857
Columns("U").ColumnWidth = 2.142857
Columns("V").ColumnWidth = 2.142857
Columns("W").ColumnWidth = 2.142857
Columns("X").ColumnWidth = 2.142857
Columns("Y").ColumnWidth = 2.142857
Columns("Z").ColumnWidth = 2.142857
Columns("AA").ColumnWidth = 2.142857
Columns("AB").ColumnWidth = 2.142857
Columns("AC").ColumnWidth = 2.142857
Columns("AD").ColumnWidth = 2.142857
Columns("AE").ColumnWidth = 2.142857
Columns("AF").ColumnWidth = 2.142857
Columns("AG").ColumnWidth = 2.142857
Columns("AH").ColumnWidth = 2.142857
Cells(4,1).Formula="'Task"
Cells(4,2).Formula="'start date"
Cells(4,3).Formula="'end date"
Cells(4,4).Formula="=min(B5:B13)"
Cells(4,4).NumberFormat = "dd/mm/yy"
Cells(4,5).Formula="730118.000000"
Cells(4,5).NumberFormat = "dd/mm/yy"
Cells(4,6).Formula="730119.000000"
Cells(4,6).NumberFormat = "dd/mm/yy"
Cells(4,7).Formula="730120.000000"
Cells(4,7).NumberFormat = "dd/mm/yy"
Cells(4,8).Formula="730121.000000"
Cells(4,8).NumberFormat = "dd/mm/yy"
Cells(4,9).Formula="730122.000000"
Cells(4,9).NumberFormat = "dd/mm/yy"
Cells(4,10).Formula="730123.000000"
Cells(4,10).NumberFormat = "dd/mm/yy"
Cells(4,11).Formula="730124.000000"
Cells(4,11).NumberFormat = "dd/mm/yy"
Cells(4,12).Formula="730125.000000"
Cells(4,12).NumberFormat = "dd/mm/yy"
Cells(4,13).Formula="730126.000000"
Cells(4,13).NumberFormat = "dd/mm/yy"
Cells(4,14).Formula="730127.000000"
Cells(4,14).NumberFormat = "dd/mm/yy"
Cells(4,15).Formula="730128.000000"
Cells(4,15).NumberFormat = "dd/mm/yy"
Cells(4,16).Formula="730129.000000"
Cells(4,16).NumberFormat = "dd/mm/yy"
Cells(4,17).Formula="730130.000000"
Cells(4,17).NumberFormat = "dd/mm/yy"
Cells(4,18).Formula="730131.000000"
Cells(4,18).NumberFormat = "dd/mm/yy"
Cells(4,19).Formula="730132.000000"
Cells(4,19).NumberFormat = "dd/mm/yy"
Cells(4,20).Formula="730133.000000"
Cells(4,20).NumberFormat = "dd/mm/yy"
Cells(4,21).Formula="730134.000000"
Cells(4,21).NumberFormat = "dd/mm/yy"
Cells(4,22).Formula="730135.000000"
Cells(4,22).NumberFormat = "dd/mm/yy"
Cells(4,23).Formula="730136.000000"
Cells(4,23).NumberFormat = "dd/mm/yy"
Cells(4,24).Formula="730137.000000"
Cells(4,24).NumberFormat = "dd/mm/yy"
Cells(4,25).Formula="730138.000000"
Cells(4,25).NumberFormat = "dd/mm/yy"
Cells(4,26).Formula="730139.000000"
Cells(4,26).NumberFormat = "dd/mm/yy"
Cells(4,27).Formula="730140.000000"
Cells(4,27).NumberFormat = "dd/mm/yy"
Cells(4,28).Formula="730141.000000"
Cells(4,28).NumberFormat = "dd/mm/yy"
Cells(4,29).Formula="730142.000000"
Cells(4,29).NumberFormat = "dd/mm/yy"
Cells(4,30).Formula="730143.000000"
Cells(4,30).NumberFormat = "dd/mm/yy"
Cells(4,31).Formula="730144.000000"
Cells(4,31).NumberFormat = "dd/mm/yy"
Cells(4,32).Formula="730145.000000"
Cells(4,32).NumberFormat = "dd/mm/yy"
Cells(4,33).Formula="730146.000000"
Cells(4,33).NumberFormat = "dd/mm/yy"
Cells(4,34).Formula="730147.000000"
Cells(4,34).NumberFormat = "dd/mm/yy"
Cells(5,1).Formula="'WP1000"
Cells(5,2).Formula="=730117"
Cells(5,2).NumberFormat = "dd/mm/yy"
Cells(5,3).Formula="=730121"
Cells(5,3).NumberFormat = "dd/mm/yy"
Cells(5,4).Interior.ColorIndex = 10
Cells(5,5).Interior.ColorIndex = 10
Cells(5,6).Interior.ColorIndex = 10
Cells(5,7).Interior.ColorIndex = 10
Cells(5,8).Interior.ColorIndex = 10
Cells(6,1).Formula="'WP2000"
Cells(6,2).Formula="=5+B5"
Cells(6,2).NumberFormat = "dd/mm/yy"
Cells(6,3).Formula="=8+C5"
Cells(6,3).NumberFormat = "dd/mm/yy"
Cells(6,9).Interior.ColorIndex = 10
Cells(6,10).Interior.ColorIndex = 10
Cells(6,11).Interior.ColorIndex = 10
Cells(6,12).Interior.ColorIndex = 10
Cells(6,13).Interior.ColorIndex = 10
Cells(6,14).Interior.ColorIndex = 10
Cells(6,15).Interior.ColorIndex = 10
Cells(6,16).Interior.ColorIndex = 10
Cells(7,1).Formula="'WP3000"
Cells(7,2).Formula="=5+B6"
Cells(7,2).NumberFormat = "dd/mm/yy"
Cells(7,3).Formula="=8+C6"
Cells(7,3).NumberFormat = "dd/mm/yy"
Cells(7,14).Interior.ColorIndex = 10
Cells(7,15).Interior.ColorIndex = 10
Cells(7,16).Interior.ColorIndex = 10
Cells(7,17).Interior.ColorIndex = 10
Cells(7,18).Interior.ColorIndex = 10
Cells(7,19).Interior.ColorIndex = 10
Cells(7,20).Interior.ColorIndex = 10
Cells(7,21).Interior.ColorIndex = 10
Cells(7,22).Interior.ColorIndex = 10
Cells(7,23).Interior.ColorIndex = 10
Cells(7,24).Interior.ColorIndex = 10
Cells(8,1).Formula="'WP4000"
Cells(8,2).Formula="=5+B7"
Cells(8,2).NumberFormat = "dd/mm/yy"
Cells(8,3).Formula="=8+C7"
Cells(8,3).NumberFormat = "dd/mm/yy"
Cells(8,19).Interior.ColorIndex = 10
Cells(8,20).Interior.ColorIndex = 10
Cells(8,21).Interior.ColorIndex = 10
Cells(8,22).Interior.ColorIndex = 10
Cells(8,23).Interior.ColorIndex = 10
Cells(8,24).Interior.ColorIndex = 10
Cells(8,25).Interior.ColorIndex = 10
Cells(8,26).Interior.ColorIndex = 10
Cells(8,27).Interior.ColorIndex = 10
Cells(8,28).Interior.ColorIndex = 10
Cells(8,29).Interior.ColorIndex = 10
Cells(8,30).Interior.ColorIndex = 10
Cells(8,31).Interior.ColorIndex = 10
Cells(8,32).Interior.ColorIndex = 10
Cells(9,1).Formula="'WP5000"
Cells(9,2).Formula="=730119"
Cells(9,2).NumberFormat = "dd/mm/yy"
Cells(9,3).Formula="=8+B9"
Cells(9,3).NumberFormat = "dd/mm/yy"
Cells(9,6).Interior.ColorIndex = 10
Cells(9,7).Interior.ColorIndex = 10
Cells(9,8).Interior.ColorIndex = 10
Cells(9,9).Interior.ColorIndex = 10
Cells(9,10).Interior.ColorIndex = 10
Cells(9,11).Interior.ColorIndex = 10
Cells(9,12).Interior.ColorIndex = 10
Cells(9,13).Interior.ColorIndex = 10
Cells(9,14).Interior.ColorIndex = 10
Cells(10,1).Formula="'WP6000"
Cells(10,2).Formula="=5+B9"
Cells(10,2).NumberFormat = "dd/mm/yy"
Cells(10,3).Formula="=8+C9"
Cells(10,3).NumberFormat = "dd/mm/yy"
Cells(10,11).Interior.ColorIndex = 10
Cells(10,12).Interior.ColorIndex = 10
Cells(10,13).Interior.ColorIndex = 10
Cells(10,14).Interior.ColorIndex = 10
Cells(10,15).Interior.ColorIndex = 10
Cells(10,16).Interior.ColorIndex = 10
Cells(10,17).Interior.ColorIndex = 10
Cells(10,18).Interior.ColorIndex = 10
Cells(10,19).Interior.ColorIndex = 10
Cells(10,20).Interior.ColorIndex = 10
Cells(10,21).Interior.ColorIndex = 10
Cells(10,22).Interior.ColorIndex = 10
Cells(11,1).Formula="'WP7000"
Cells(11,2).Formula="=5+B10"
Cells(11,2).NumberFormat = "dd/mm/yy"
Cells(11,3).Formula="=8+C10"
Cells(11,3).NumberFormat = "dd/mm/yy"
Cells(11,16).Interior.ColorIndex = 10
Cells(11,17).Interior.ColorIndex = 10
Cells(11,18).Interior.ColorIndex = 10
Cells(11,19).Interior.ColorIndex = 10
Cells(11,20).Interior.ColorIndex = 10
Cells(11,21).Interior.ColorIndex = 10
Cells(11,22).Interior.ColorIndex = 10
Cells(11,23).Interior.ColorIndex = 10
Cells(11,24).Interior.ColorIndex = 10
Cells(11,25).Interior.ColorIndex = 10
Cells(11,26).Interior.ColorIndex = 10
Cells(11,27).Interior.ColorIndex = 10
Cells(11,28).Interior.ColorIndex = 10
Cells(11,29).Interior.ColorIndex = 10
Cells(11,30).Interior.ColorIndex = 10
Cells(12,1).Formula="'WP8000"
Cells(12,2).Formula="=5+B11"
Cells(12,2).NumberFormat = "dd/mm/yy"
Cells(12,3).Formula="=8+C11"
Cells(12,3).NumberFormat = "dd/mm/yy"
Cells(12,21).Interior.ColorIndex = 10
Cells(12,22).Interior.ColorIndex = 10
Cells(12,23).Interior.ColorIndex = 10
Cells(12,24).Interior.ColorIndex = 10
Cells(12,25).Interior.ColorIndex = 10
Cells(12,26).Interior.ColorIndex = 10
Cells(12,27).Interior.ColorIndex = 10
Cells(12,28).Interior.ColorIndex = 10
Cells(12,29).Interior.ColorIndex = 10
Cells(12,30).Interior.ColorIndex = 10
Cells(12,31).Interior.ColorIndex = 10
Cells(12,32).Interior.ColorIndex = 10
Cells(12,33).Interior.ColorIndex = 10
Cells(12,34).Interior.ColorIndex = 10
Cells(13,1).Formula="'WP9000"
Cells(13,2).Formula="=5+B12"
Cells(13,2).NumberFormat = "dd/mm/yy"
Cells(13,3).Formula="=8+C12"
Cells(13,3).NumberFormat = "dd/mm/yy"
Cells(13,26).Interior.ColorIndex = 10
Cells(13,27).Interior.ColorIndex = 10
Cells(13,28).Interior.ColorIndex = 10
Cells(13,29).Interior.ColorIndex = 10
Cells(13,30).Interior.ColorIndex = 10
Cells(13,31).Interior.ColorIndex = 10
Cells(13,32).Interior.ColorIndex = 10
Cells(13,33).Interior.ColorIndex = 10
Cells(13,34).Interior.ColorIndex = 10
ActiveSheet.Shapes.AddLine(342, 132,415,132)
ActiveSheet.Shapes.AddLine(321, 91,340,91)
ActiveSheet.Shapes.AddLine(341, 91,341,133)
Set objbutton = ActiveSheet.Buttons.Add (28,16,82,33)
objbutton.OnAction = "redraw"
objbutton.Text = "update"
Worksheets(2).Activate
Worksheets(3).Activate
Worksheets(1).Activate
End Sub
