永中集成Office2009个人版免费下载

查看完整版本: 下列VBA代码的宏该如何改用于永中

xiaoniu29 2006-8-16 13:02

下列VBA代码的宏该如何改用于永中

Private Sub workbook_BeforeClose(Cancel As Boolean)
    ActiveWorkbook.Save
End Sub

Private Sub Workbook_Open()
    FR = Cells(Rows.Count, 3).End(xlUp).Row ‘注意这一句,有没有同样功能的java语句?
    Cells(FR + 1, 1).Formula = "=today()"
    If Cells(FR, 1).Value < Cells(FR + 1, 1).Value Then
        Cells(FR + 1, 1) = Cells(FR + 1, 1).Value
        Cells(FR + 1, 2).FormulaR1C1 = "=R[-1]C[4]"
        Cells(FR + 1, 4).FormulaR1C1 = "=RC[-1]*0.4"
        Cells(FR + 1, 5).FormulaR1C1 = "=RC[-3]-RC[-1]"
        Cells(FR + 1, 7).FormulaR1C1 = "=IF(RC[-2]=RC[-1],0,RC[-2]-RC[-1])"
        Else: Cells(FR + 1, 1) = ""
    End If
    If FR Mod 2 Then
        Range(Cells(FR + 1, 1), Cells(FR + 1, 7)).Select
        With Selection.Interior
            .ColorIndex = 15
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
        End With
    End If
    Cells(FR + 1, 3).Select
End Sub

高手指教!

[[i] 本帖最后由 xiaoniu29 于 2006-8-16 18:40 编辑 [/i]]

macrosuner 2006-10-31 12:25

描述一下具体功能实现

描述一下具体功能实现
页: [1]
查看完整版本: 下列VBA代码的宏该如何改用于永中