Posts by ArunPeswani

    Hi royUK,


    Thanks for your reply.

    You are right about description of xlsx, xls, xlxm extentions.

    However, your prescribed solution did not work as desired. I need the user to select some cells in a worksheet other than the one where macro nis recorded. Hence, the inputbox will show the range address as [Source.xlsx]SheetA!$A$1:$C$10 which I want to copy or store in a variable, while your code displays msgbox with simple address as $A$1:$C$10 which I was anyways getting from my existing code.


    Do it like this, save macro in workbook1, run it, inputbox will appear in screen, switch to workbook2 and select some cells. It will show you the address of selected cells as [Source.xlsx]SheetA!$A$1:$C$10 and not as $A$1:$C$10.

    I have coded a small vba Macro in the workbook named Destination.xlsx, and it is as follows:

    Code
    Sub GetDataArea()
        Dim rng As Range
        Set rng = Application.InputBox("Select the cells.", Type:=8)
    End Sub

    I have selected InputBox Type:=8 because I want users to select some cells and then I want to copy the cell reference or address of those selected cells. The problem here is that the Macro is coded in Destination.xlsx, I want the user to select cells in Source.xlsx (it can be any workbook of users' choice), and copy the cell reference or cell address of Source.xlsx. It looks like the screenshot attached here >InputBox

    Basically, I want to copy the text [Source.xlsx]SheetA!$A$1:$C$10 from my Inputbox. I am not sure how do I get this. I tried rng.address but it returns only $A$1:$C$10 While need complete reference as [Source.xlsx]SheetA!$A$1:$C$10

    Pls help...