Input Box

  • Thread starter Thread starter Chris Gorham
  • Start date Start date
C

Chris Gorham

Hi,

I'm attempting to read in the address of the active cell
using the input box method:

Set activecell_position = Application.InputBox
(prompt:="Input desired active cell position",
title:="Active Cell Position",
Default:=ActiveCell.Address, Type:=8)

If I cancel out the resulting form then this code returns
an error....

Thks...Chris
 
Chris

not sure why you're doing this but try this:

Sub test()
On Error Resume Next
Set activecell_position = _
Application.InputBox(Prompt:="Input desired active cell position", _
Title:="Active Cell Position", _
Default:=ActiveCell.Address, _
Type:=8)
MsgBox activecell_position.Address
On Error GoTo 0
End Sub

Regards

Trevor
 
Back
Top