Skip to content

Instantly share code, notes, and snippets.

@koni
Created February 12, 2011 08:51
Show Gist options
  • Save koni/823625 to your computer and use it in GitHub Desktop.
Save koni/823625 to your computer and use it in GitHub Desktop.
emr処理
Sub go()
Dim cue_count As Integer
Dim eyerecord_count As Long
Dim cue_min(0 To 50) As Long
Dim cue_max(0 To 50) As Long
Dim eyerecord_val As Long
Dim tmp(0 To 10) As Integer
' Responseシート読み込み
Worksheets("Response").Activate
cue_count = 2
While Not IsEmpty(Cells(cue_count, 2).Value)
cue_min(Cells(cue_count, 7)) = Cells(cue_count, 1).Value
cue_max(Cells(cue_count, 7)) = Cells(cue_count, 2).Value
cue_count = cue_count + 1
Wend
' 処理
Worksheets("Eyerecord").Activate
eyerecord_count = 2
While Not IsEmpty(Worksheets("Eyerecord").Cells(eyerecord_count, 2).Value)
tmp(0) = Mid(Worksheets("Eyerecord").Cells(eyerecord_count, 2).Value, 5, 2)
tmp(1) = Mid(Worksheets("Eyerecord").Cells(eyerecord_count, 2).Value, 8, 2)
tmp(2) = Mid(Worksheets("Eyerecord").Cells(eyerecord_count, 2).Value, 11, 2)
tmp(3) = Mid(Worksheets("Eyerecord").Cells(eyerecord_count, 2).Value, 14, 3)
eyerecord_val = CLng(((tmp(0) * 60 + tmp(1)) * 60 + tmp(2))) * 1000
eyerecord_val = eyerecord_val + tmp(3)
cue_count = 2
For i = 1 To 30
If cue_min(i) <= eyerecord_val And cue_max(i) >= eyerecord_val Then
Worksheets("Eyerecord").Cells(eyerecord_count, 8).Value = i
Exit For
End If
Next i
eyerecord_count = eyerecord_count + 1
Wend
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment