|
こんな感じでどうかな ? シートモジュールに入れてみて下さい。
Private MyF As String
Private Sub Worksheet_Activate()
With ActiveSheet
If .ProtectContents Then .UnProtect
.Protect UserInterfaceOnly:=True
End With
If MyF = "" Then
MyF = Application.DefaultFilePath & "\" & _
Format(Date, "yyyy_mm_dd") & "日中足.txt"
End If
If Dir(MyF) = "" Then
Open MyF For Output Access Write As #1
Print #1, Format(Date, "yyyy/mm/dd")
Close #1
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim C As Range
Dim St As String
If Dir(MyF) <> "" Then
St = ""
For Each C In Target.EntireRow.SpecialCells(2)
St = St & C.Text & ","
Next
St = St & Format(Time, "hh:mm:ss")
Open MyF For Append Access Write As #1
Print #1, St
Close #1
End If
End Sub
|
|