You cannot use the Immediate window interactively. Firstly, while the subroutine is running, it will not accept any keyboard input. However, you can use it to transfer data to a sub or function when it is called, so in a sense you can “copy” data that already exists. Something like that:
Sub AddNums(ParamArray nums())
Dim total As Double
Dim i As Long
For i = 0 To UBound(nums)
total = total + nums(i)
Next i
Debug.Print total
End Sub
For example:

- VBScript script, , VBA ( script), , , script . , , , ( ) VBA.