Q:

is there any command equivalent to readline in vba?

Is there a command equivalent to readLine of Java in VBA.
I want to use the text input in the immediate window and put it in a variable.
Is it possible?

A:

You can't use the Immediate Window interactively. For one thing -- while a sub is running it won't accept any keyboard input. You can, however, use it to pass data to a sub or function when you invoke it, so in a sense you can "scrape" data that is there already. Something along these lines:
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:

Beyond that -- you could move the input-gathering phase to a VBScript script running in console mode, invoke it from VBA, and use either a file (which the script writes to) or perhaps the clipboard to get the data from the script after it is done running. This should be feasible, though it is probably better to find a more idiomatic (form-based) way to do it within VBA.

A:

I am not quite sure why you need to write from Immediate Window to a variable at a runtime - is it some weird debugging practices?
Normally, if you need to take an input you end up with a form to interact with an user.
However, if you do need to write to a variable at a runtime consider the following:
Sub Main()

    Dim immediateInput As String
    Dim readImmediate As Boolean
    Do While (readImmediate = False)
        readImmediate = True
    Loop

End Sub

now, set a breakpoint at the readImmediate = true line and add immediateInput to the Watch. Bring up both the Immediate Window and Watches and run the macro.
When the runtime hits the breakpoint enter the below in the Immediate Window:
immediateInput = "hello world"
Now have a look in the Watches; your immediateInput's value should be "hello world".

