Getting Cell Reference With Input Box

We can get an input from user using Input Box, but we also can use the Input Box to get the address of cell reference in Microsoft Excel.

Using simple Excel VBA procedure below we can ask user to select range of cells (as copy input) and where they want it paste.

Sub CopyPaste()

Dim InputCells As Excel.Range
Dim OutputCells As Excel.Range

On Error Resume Next

'Show input box to get range of cells that want to copy
Set InputCells = _
Application.InputBox(Prompt:="Block input cells/range", _
Title:="Copy Paste", Type:=8)

'Show input box to get where they want it paste
Set OutputCells = _
Application.InputBox(Prompt:="Select cell where you want paste it", _
Title:="Copy Paste", Type:=8)

'Copy range of input cells
InputCells.Copy

'Paste it into output cells reference
OutputCells.PasteSpecial (xlPasteAll)

End Sub

Run the excel macro, when the first input box show up, block range of cells that we want to copy, click OK, and when the second input box showed, choose destination cell and click OK, then the source cells will be copied into the destination cell.

This entry was posted in Excel VBA Function and tagged , , , , , , , . Bookmark the permalink.

1,816 Responses to Getting Cell Reference With Input Box

  1. Pingback: check this out

  2. Pingback: incontinence pads

  3. Pingback: escort perth wa

  4. Pingback: intangible

  5. Pingback: payday loans

  6. Pingback: gogo games

  7. Pingback: buy list

  8. Pingback: http://bestunderwatercameras.net/

  9. Pingback: The Symbol MC1000 lightweight mobile computer

  10. Pingback: security window film

  11. Pingback: servis char

  12. Pingback: klockor

  13. Pingback: IM Lobby

  14. Pingback: promoting and celebrating Virginia creativity

  15. Pingback: cumming tree service

  16. Pingback: success

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>