PDA

View Full Version : Solved: Prompt user for a range of cells to copy



pcollins
11-17-2007, 02:52 PM
How could you prompt a user to select a range of cells to copy have them hit enter or something to signify that those are the cells that they want copied and continue on with macro?

mikerickson
11-17-2007, 03:42 PM
Dim inputRange As Range
On Error Resume Next
Set inputRange = Application.InputBox("Choose A Range, with the mouse", Type:=8)
On Error GoTo 0
If Nothing Is inputRange Then
MsgBox "Cancel was pressed."
Else
MsgBox inputRange.Address & " was chosen."
End If

TonyJollans
11-17-2007, 03:44 PM
Set YourRange = Application.InputBox(Prompt:="Select Range", Type:=8)

TonyJollans
11-17-2007, 03:45 PM
Beaten to it - and a more comprehensive post :)

lucas
11-18-2007, 08:46 AM
Mike is hard to beat but too many correct answers is always better...cheers Tony