|
第1案、後で処理するマクロ内で以下の様にシリアル値に変換する
Public Sub Test1()
Dim vntData As Variant
vntData = Range("A1").Value
vntData = TimeSerial(vntData \ 100, vntData Mod 100, 0)
MsgBox vntData
End Sub
第2案、シートの「Sub Worksheet_Change」で入力時にシリアル値に変換
(セル書式は「[h]:mm」形式)
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim vntData As Variant
With Target
If Not (.Row = 1 And .Column = 1 And .Count = 1) Then
Exit Sub
End If
vntData = Target.Value2
End With
vntData = TimeSerial(vntData \ 100, vntData Mod 100, 0)
Application.EnableEvents = False
Target.Value = vntData
Application.EnableEvents = True
End Sub
では?
|
|