sanantonio
Board Regular
- Joined
- Oct 26, 2021
- Messages
- 124
- Office Version
- 365
- Platform
- Windows
Hi All,
Have inherited the following macro. It basically loops through a list of numbers and sendkeys them all into a computer-specific data input screen.
Could anyone please help me with a translation? I've added my own where I can determine what's what.
Not really sure how it works, I presume somewhere in there we're telling it to input what is in the cell, then the next etc.
It seems to only work when you have the correct cell highlighted to begin with. I presume this is dictated by this line of code:
Could someone help me out with the correct code for making this work regardless of what cell you have highlighted if the numbers always begin in D7 ?
Thanks y'all!
Have inherited the following macro. It basically loops through a list of numbers and sendkeys them all into a computer-specific data input screen.
Could anyone please help me with a translation? I've added my own where I can determine what's what.
VBA Code:
Sub ALO_SendKeys()
Dim i As Long
Dim U As Long
For i = ActiveCell.Row To Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
'Minimizes excel window
Application.WindowState = xlMinimized
'If blank return 0
If Cells(i, ActiveCell.Column) = "" Then
Application.SendKeys ("0")
Else
End If
Application.SendKeys Cells(i, ActiveCell.Column), True
Application.SendKeys "{DOWN}"
Next i
Application.SendKeys "{NUMLOCK}"
End Sub
Not really sure how it works, I presume somewhere in there we're telling it to input what is in the cell, then the next etc.
It seems to only work when you have the correct cell highlighted to begin with. I presume this is dictated by this line of code:
VBA Code:
For i = ActiveCell.Row To Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
Could someone help me out with the correct code for making this work regardless of what cell you have highlighted if the numbers always begin in D7 ?
Thanks y'all!