+ Reply to Thread
Results 1 to 6 of 6

Use address of named range to find same address in another worksheet

  1. #1
    Registered User
    Join Date
    06-08-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    7

    Use address of named range to find same address in another worksheet

    Hi

    Let's assume I have Sheet1. On it I've named cell A5 as "MyRange". I want to jump to MyRange using its name, find and put its address (A5) in a variable, and then jump to Sheet2 and select the same cell address (A5) on Sheet2 by using the address assigned to the variable.

    I've been at this for an hour or so, but when I use something like ActiveSheet.Cells(MyRange).Select it jumps back to Sheet1(A5) instead of selecting A5 on Sheet2.

    Thanks!

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Use address of named range to find same address in another worksheet

    In two steps:

    Please Login or Register  to view this content.
    Gary's Student

  3. #3
    Registered User
    Join Date
    06-08-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Use address of named range to find same address in another worksheet

    Jacobshavn

    Thank you for the reply. I've tested the code given, but it still jumps back to the previous sheet.

    Let me be more precise with my problem. I'm actually jumping between workbooks. Here is a simplified example of my code:
    Please Login or Register  to view this content.
    After this last line it still selects "MyRange" in OldBook, instead of the same address in NewBook, even though NewBook is the active book.

    The reason I want need to do this is because I need to give the same range name to cell A5 in NewBook. I therefore need to select it using code. Once I'm on it it's easy to name it.

    Thank you for your help!
    Last edited by dwsteyl; 06-08-2013 at 04:19 PM. Reason: Corrected a typing error ;)

  4. #4
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Use address of named range to find same address in another worksheet

    Try the following:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-08-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Use address of named range to find same address in another worksheet

    Thanks - I've tried that.

    It's giving an error: Object doesn't support this property or method

  6. #6
    Registered User
    Join Date
    06-08-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Use address of named range to find same address in another worksheet

    Hi

    I don't know why, but this works:

    Please Login or Register  to view this content.
    Thank you for the suggenstions!

+ 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