+ Reply to Thread
Results 1 to 5 of 5

Sheets Missing From Reference

  1. #1
    Registered User
    Join Date
    03-18-2009
    Location
    Massachusetts, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Sheets Missing From Reference

    I would like to use an input box to ask the user to select a range that may be another sheet. If it is on another sheet, the returned range references only the cells without the sheet. How can I return the source sheet too?

    Set myrange = Application.InputBox(Prompt:="Choose a range", Title:="Choose", Type:=8)

    'User selects a range on another sheet....
    mystring = myrange.Address

    Any guidance would be appreciated. Thanks

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sheets Missing From Reference

    Hi,

    You could use the .Parent property of the range to obtain the sheet name.

    e.g.

    Please Login or Register  to view this content.
    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-18-2009
    Location
    Massachusetts, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Sheets Missing From Reference

    Richard,

    Thanks, but this command returns the name of the sheet that was active when the input box was called, not where the range was selected.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sheets Missing From Reference

    Hi,

    Your original post had implied that the user had already activated a cell on the sheet in question.

    How do you expect the system to know which sheet the user has in mind when he calls the input box? You will either need to get the user to navigate to a sheet so that you can use the name, or prompt the user for a sheet name as well as a range name/address.

    HTH

  5. #5
    Registered User
    Join Date
    03-18-2009
    Location
    Massachusetts, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Sheets Missing From Reference

    Richard, Thanks again, and sorry if I confused you. When the input box opens, the user can select another sheet. The box stays up and when the user highlights a range, the box displays the sheet with the range address. I found it strange that the sheet name was "volatile". After selecting OK, only the cell address is returned.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1