Help with Application.InputBox(,,,,,8)

  • Thread starter Thread starter JsJ_Slim
  • Start date Start date
J

JsJ_Slim

Hi,
I'm using Application.InputBox(,,,,,8) in my Excel vsto AddIn to retrieve a
Range. However, I need help getting the exact reference text.

Eg, selecting a range, then hitting F4 to turn it to A$1 instead of $A$1.
I'm trying to get A$1, but the only way that I can think of to get the
address is via range.get_Address, which returns me $A$1 format instead of A$1.

Please help.

Thanks
 
I don't know what is range.get_Address, but if your currently selected cell
is A1 then
selection.address(true,false)
returns A$1.

Regards,
Stefi

„JsJ_Slim†ezt írta:
 
Hi Bob and Stefi

Thanks for the reply. range.get_Address(true, false) worked, but only if I
know if I know whether the row (and/or) column is absolute/relative.

Basically, I'm calling Application.InputBox(,,,,8) such that the user can
select a range from the spreadsheet, during which they may use F4 to dictate
if the row/column is absolute/relative. At the end, a Range object is
returned.

What I need is to transform this returned range into the *exact* same
reference that appeared in the refedit box (eg, =$A$1, or =A$1 or =$A1, etc).

An example of its usage: I have an Excel addin that uses the
Application.Input() to allow the user to select a range. Having got that, the
addin will then insert a formula (including the range reference) into the
spreadsheet. And assume that one of the requirements is that the included
range reference must appear *exactly* like what the user specified (absolute
row (or/and) column)in the Application.Input().

Hence, if the user selected $A1 in Application.Input(), the formula must
show $A1; if the user selected A$1, then it must appear as A$1, etc.

Sorry if I'm making things confusing. If you need any further
clarifications/examples, please let me know.

Thanks!
 

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

Back
Top