Google は私が望むものをまったく与えてくれませんでした。おそらく SO が答えを持っているのではないかと思いました。
セルに保存される情報をユーザーに要求する入力ボックスまたはユーザー プロンプトを使用する代わりに、数式バーのクリックをシミュレートするコードを探しています。現在、「F2」でsendkeysメソッドを使用して、ユーザーが選択したセルに情報を入力できるようにしています。データの海の単一のセルではなく、数式バーを調べる方がはるかに簡単です。
Sub CopyTemplate()
'ActiveWorkbook.Save
Worksheets("HR-Cal").Activate
Dim rng As Range
Dim trng As Range
Dim tco As String
'Use the InputBox select row to insert copied cells
Set rng = Application.InputBox("select row to paste into", "Insert template location", Default:=ActiveCell.Address, Type:=8)
If rep = vbCancel Then
End If
startrow = rng.Row
' MsgBox "row =" & startrow
Range("AG2") = startrow
Application.ScreenUpdating = False
'copy template block
Range("C6").End(xlDown).Select
Range("AG1") = ActiveCell.Row
tco = "A5:AN" & Range("AG1")
Range(tco).Select
Selection.Copy
Range("A" & Range("AG2")).Activate
Selection.Insert Shift:=xlDown
Range("c100000").End(xlUp).Select
Selection.End(xlUp).Select
'select first value
Range("AG1:AG2").ClearContents
Application.ScreenUpdating = True
SendKeys "{F2}"
SendKeys "{BS}"
End Sub