Input Box

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
 
T

Trevor Shuttleworth

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top