IvoOvermars
New Member
- Joined
- Aug 6, 2010
- Messages
- 12
Hello,
I had to enter 3 x 1800 sudentnumbers in a webbased application (magister) by hand. I ended up writing this code and the pressure is off. Next year however the same will have to be done.
And I'm trying to optimise this. I'm using the SendKeys command and I would like to replace this with some other code. I have no clue how to do that.
I had to enter 3 x 1800 sudentnumbers in a webbased application (magister) by hand. I ended up writing this code and the pressure is off. Next year however the same will have to be done.
And I'm trying to optimise this. I'm using the SendKeys command and I would like to replace this with some other code. I have no clue how to do that.
VBA Code:
Sub leerlinginvoer()
'
ActiveCell.Copy
Application.Wait (Now() + TimeValue("00:00:01"))
SendKeys "%{TAB}"
Application.Wait (Now() + TimeValue("00:00:01"))
'clear input field
SendKeys "{BACKSPACE}"
SendKeys "{BACKSPACE}"
SendKeys "{BACKSPACE}"
SendKeys "{BACKSPACE}"
SendKeys "{BACKSPACE}"
SendKeys "{BACKSPACE}"
SendKeys "^{v}"
Application.Wait (Now() + TimeValue("00:00:01"))
SendKeys "{DOWN}"
SendKeys "{enter}"
Application.Wait (Now() + TimeValue("00:00:01"))
Do Until ActiveCell = NullString
'nieuwe cell
ActiveCell.Copy
SendKeys "%{TAB}"
Application.Wait (Now() + TimeValue("00:00:01"))
ActiveCell.Offset(0, 1).Select
ActiveCell.Copy
Application.Wait (Now() + TimeValue("00:00:01"))
SendKeys "%{TAB}"
Application.Wait (Now() + TimeValue("00:00:01"))
SendKeys "{BACKSPACE}"
SendKeys "{BACKSPACE}"
SendKeys "{BACKSPACE}"
SendKeys "{BACKSPACE}"
SendKeys "{BACKSPACE}"
SendKeys "{BACKSPACE}"
SendKeys "^{v}"
Application.Wait (Now() + TimeValue("00:00:01"))
SendKeys "{DOWN}"
SendKeys "{enter}"
Application.Wait (Now() + TimeValue("00:00:01"))
Loop
MsgBox "Next"
End Sub