|
▼ハチ さん:
イメージとしてはこんな感じでしょうか。
わかってなくて本当にすみません。
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim Cnm As String
Dim Pnm As String
Dim Mnm As String
Dim Tnm As String
Dim ws1 As Worksheet
Dim i As Long
If Not Application.Intersect(Range("B3:B100"), Target) Is Nothing Then
With Target
Cnm = .Offset(, -1).Value
Pnm = .Offset(0, 0).Value
Mnm = .Offset(, 3).Value
Tnm = .Offset(, 5).Value
End With
Set ws1 = Worksheets("history")
For i = 5 To ws1.Range("B65535").End(xlDown).Row
If IsEmpty(ws1.Cells(i, 2).Value) Then
ws1.Cells(i, 2).Value = Cnm
ws1.Cells(i, 3).Value = Pnm
ws1.Cells(i, 4).Value = Mnm
ws1.Cells(i, 9).Value = Tnm
Goto Eline
Exit For
End If
Next i
Cancel = True
End If
Eline:
Private Sub UserForm_Initialize()
Calendar1.Value = Date
カレンダーの日付をセルにセットする
End Sub
Private Sub Calendar1_Click()
TextBox1.Value = Calendar1.Value
カレンダーの日付をセルにセットする
End Sub
Private Sub カレンダーの日付をセルにセットする()
ws1.Cells(i, 5).Value = Calendar1.Value
End Sub
Private Sub CommandButton1_Click()
Unload UserForm1
End Sub
Private Sub UserForm_Deactivate()
Unload UserForm1
End Sub
End Sub
|
|