| |
▼しんく さん:
>1点だけよろいいでしょうか。
>日付の重複チェックを追加することは難しいですか。
>B列の日付で18:00と18:00があった場合、片方は不要にしたいのです。
Try1() をすこし修正して、
すでにある文字列の中に 追加しようとしている文字列がないときだけ
時刻を追加しています。
Sub Try1b() '重複時刻カット
Dim c As Range
Dim ss As String
Dim st As String
For Each c In Range("B30", Cells(Rows.Count, 2).End(xlUp)) _
.SpecialCells(xlCellTypeConstants, xlNumbers)
If IsDate(c.Text) Then
If Len(ss) = 0 Then
ss = Format$(c.Value2, "yyyy/mm/dd hh:nn")
Else
st = Format$(c.Value2, "hh:nn")
If InStr(ss, st) = 0 Then ss = ss & ("、" & st)
End If
End If
Next
Range("B25").Value = "発生時間:" & ss
End Sub
|
|