Új hozzászólás Aktív témák

  • Belnir

    csendes tag

    válasz Delila_1 #29353 üzenetére

    Akkor is, ha nem menti el?

    A kód jelenleg ilyen, lehet, hogy ebben van a hiba (amikor másolgattam) - valamint a sorrend fontos?

    Private Sub Workbook_Open()
    Dim lastrow As Long
    Application.ScreenUpdating = False

    With Worksheets("Rejtett")
    lastrow = .Range("A" & Rows.Count).End(xlUp).Row + 1
    With .Range("A" & lastrow)
    .Offset(0, 0).Value = "OPEN"
    .Offset(0, 1).Value = ThisWorkbook.FullName
    .Offset(0, 2).Value = Now()
    .Offset(0, 3).Value = "'*"
    .Offset(0, 4).Value = "'*"
    .Offset(0, 5).Value = Environ$("username")
    .Offset(0, 6).Value = Environ$("computername")
    .Offset(0, 7).Value = Environ$("userdomain")
    End With
    End With

    Application.ScreenUpdating = True
    End Sub

    Private Sub Workbook_AfterSave(ByVal Success As Boolean)

    Dim lastrow As Long
    Application.ScreenUpdating = False

    With Worksheets("Rejtett")
    lastrow = .Range("A" & Rows.Count).End(xlUp).Row + 1
    With .Range("A" & lastrow)
    .Offset(0, 0).Value = "OPEN"
    .Offset(0, 1).Value = ThisWorkbook.FullName
    .Offset(0, 2).Value = Now()
    .Offset(0, 3).Value = "'*"
    .Offset(0, 4).Value = "'*"
    .Offset(0, 5).Value = Environ$("username")
    .Offset(0, 6).Value = Environ$("computername")
    .Offset(0, 7).Value = Environ$("userdomain")
    End With
    End With

    Application.ScreenUpdating = True

    End Sub

    Private Sub Workbook_BeforeClose(Cancel As Boolean)

    Dim lastrow As Long
    Application.ScreenUpdating = False

    With Worksheets("Rejtett")
    lastrow = .Range("A" & Rows.Count).End(xlUp).Row + 1
    With .Range("A" & lastrow)
    .Offset(0, 0).Value = "OPEN"
    .Offset(0, 1).Value = ThisWorkbook.FullName
    .Offset(0, 2).Value = Now()
    .Offset(0, 3).Value = "'*"
    .Offset(0, 4).Value = "'*"
    .Offset(0, 5).Value = Environ$("username")
    .Offset(0, 6).Value = Environ$("computername")
    .Offset(0, 7).Value = Environ$("userdomain")
    End With
    End With

    Application.ScreenUpdating = True

    End Sub

Új hozzászólás Aktív témák