VisualBasic 매크로를 위한 기본적인 거

Posted by 겨울에
2011. 2. 4. 02:14 scrap/ Visual Basic
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
 
 
 
Private Sub Timer1_Timer()
Dim i As Integer
'F5버튼을 누름 {루푸 10}{탭}{탭}{탭}{스페이스}{탭}{탭}
If GetAsyncKeyState(vbKeyF5) Then
For i = 1 To 10
SendKeys "{TAB 3} {TAB 2}"
Next
vbKeyEnd_F5:
If GetAsyncKeyState(vbKeyF5) Then
GoTo vbKeyEnd_F5
End If
End If
'F6버튼을 누름 {루푸 10}{탭}{탭}{탭}{탭}{탭}{DOWN}
If GetAsyncKeyState(vbKeyF6) Then
For i = 1 To 10
SendKeys "{TAB 5}{DOWN}"
Next
vbKeyEnd_F6:
If GetAsyncKeyState(vbKeyF6) Then
GoTo vbKeyEnd_F6
End If
End If
End Sub