Hello there, I've been trying to figure out a way to quickly insert new rows without lots of button presses.
If I run this through the MACRO screen, it works perfectly fine:
If I try to do it through a key binding, it doesn't.
So, I tried to break it down into stages and whilst stage one works (press shift and spacebar, then alt, i & r).
The issue is that unlike when it's run manually, doing it this way, it sees i and r as button presses without alt. So, I am not sure how to fix this?
This
If I run this through the MACRO screen, it works perfectly fine:
Code:
Public Sub NewRow()
Application.SendKeys "+( )%(ir){UP}{DOWN}"
End Sub
If I try to do it through a key binding, it doesn't.
So, I tried to break it down into stages and whilst stage one works (press shift and spacebar, then alt, i & r).
Code:
Private Sub Worksheet_Activate()
Application.OnKey "^ ", "Sheet1.NewRow"
End Sub
Public Sub NewRow()
Application.SendKeys "+( )"
Application.Wait (Now + TimeValue("0:00:01"))
Application.SendKeys "%(ir){UP}{DOWN}"
End Sub
Private Sub Worksheet_Deactivate()
Application.OnKey "^ "
End Sub
Sub Fill()
Selection.DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, _
Trend:=True
End Sub
The issue is that unlike when it's run manually, doing it this way, it sees i and r as button presses without alt. So, I am not sure how to fix this?
This