Search notes:

Office Object Model: Excel - Application.inputBox

inputBox() lets the user enter different values or range.

Entering basic types

With the type parameter set to 1, 2 or 4, application.inputBox allows to enter numbers, strings or booleans.
option explicit

sub main() ' {

    dim num as double
    dim txt as string
    dim bol as boolean

    num = application.inputBox("Enter a number" , "Example", type := 1) : debug.print("num = " & num)
    txt = application.inputBox("Enter a string" , "Example", type := 2) : debug.print("txt = " & txt)
    bol = application.inputBox("Enter a boolean", "Example", type := 4) : debug.print("bol = " & bol)

end sub ' }
Github repository about-MS-Office-object-model, path: /Excel/Application/inputBox/number-string-boolean.bas

Entering ranges

With type := 8, inputBox lets the user enter a range by selecting it with the mouse (and then process the range in the VBA code).
option explicit

sub main() ' {

    dim rng as range

    set rng = application.inputBox("Enter a range"  , "Example", type := 8)

    debug.print("The entered range is: " & rng.address)

end sub ' }
Github repository about-MS-Office-object-model, path: /Excel/Application/inputBox/range.bas

See also

The VBA function msgBox() and inputBox()

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Microsof...', 1758194138, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/Office/Excel/Object-Model/Application/inputBox(81): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78