- ©«¤l
- 552
- ¥DÃD
- 3
- ºëµØ
- 0
- ¿n¤À
- 578
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-2-8
- ³Ì«áµn¿ý
- 2024-7-9
  
|
¥»©«³Ì«á¥Ñ lpk187 ©ó 2015-10-13 16:08 ½s¿è
¦^´_ 21# ¤p«L«È
¦³®ÉÔ¡A¸ÕÅç¤@¤U´Nª¾¹D¡A¤U±§A¸Õ¤@¤U´Nª¾¹D¤£·|¼W¥[¡I- Set LayoutRS = ConfigCN.Execute(LayoutSQL)
- B = 2
- C = 3
- D = 4
-
- For i = StartYear To EndYear
- 'Out.Columns("B:D").Insert
- Out.Range(Columns(C), Columns(D)).Columns.Group
- Out.Cells(1, B) = i & " / FY"
- Out.Cells(1, C) = i & " / 2H"
- Out.Cells(1, D) = i & " / 1H"
-
- With LayoutRS
- .MoveFirst
-
- Do Until .EOF
- If Out.Cells(.Fields("Item_ID"), 1) = "" Then
- Out.Cells(.Fields("Item_ID"), 1) = .Fields("Item_Name").Value
- 'End If
- End If
- .MoveNext
- Loop
- End With
-
- DataSQL = "select * from tbl_Income_Sub where Code = " & Code & " and S_Year = '" & i & "'"
- Set DataRS = DataCN.Execute(DataSQL)
- With DataRS
- Do Until .EOF
- Select Case .Fields("Term")
- Case "1H"
- TargetCol = D
- Case "FY"
- TargetCol = B
- End Select
- Out.Cells(2, TargetCol) = .Fields("Currency")
- Out.Cells(3, TargetCol) = .Fields("Unit")
- Out.Cells(4, TargetCol) = .Fields("Report_Date")
- CurrUnit = .Fields("Unit")
- If TargetCol = B Then
- Out.Cells(2, TargetCol + 1) = .Fields("Currency")
- Out.Cells(3, TargetCol + 1) = .Fields("Unit")
- Out.Cells(4, TargetCol + 1) = .Fields("Report_Date")
- End If
- .MoveNext
- Loop
- End With
-
- DataSQL = "select * from tbl_Income where Code = " & Code & " and S_Year = '" & i & "'"
- Set DataRS = DataCN.Execute(DataSQL)
-
- With DataRS
- Do Until .EOF
- If Not Out.Columns(1).Find(.Fields("Item"), lookat:=xlWhole) Is Nothing Then
- TargetRow = Out.Columns(1).Find(.Fields("Item"), lookat:=xlWhole).Row
- Select Case .Fields("Term")
- Case "1H"
- TargetCol = D
- Case "FY"
- TargetCol = B
- End Select
- Out.Cells(TargetRow, TargetCol) = Round(.Fields("Amount"), 4)
- End If
- .MoveNext
- Loop
- End With
- B = B + 3
- C = C + 3
- D = D + 3
- Next i
½Æ»s¥N½X |
|