+ Reply to Thread
Results 1 to 8 of 8

Error when "mirroring" named ranges between worksheets

  1. #1
    Registered User
    Join Date
    07-08-2014
    Location
    Denver, CO
    MS-Off Ver
    2013
    Posts
    7

    Error when "mirroring" named ranges between worksheets

    Hello,
    I have several named ranges on a worksheet, which are intended to "mirror" another range in another sheet so that if info is typed, deleted, or copied into a cell in sheet 1, it will automatically appear in the corresponding range in sheet 2. The code below references what I've put in the front sheet.

    When I open the workbook and change a cell value in sheet 1 (range MBO_FFV_1), I get an error "Run time error 424, Object required". The debugger takes me to the line " [MBO_FFV_2].Value = [MBO_FFV_1].Value".

    Of course, the same code is copied in sheet 2 with the appropriate range names switched. The mirroring will work if I type in sheet 2 without any error, but if I type in sheet 1 i get the error.

    I can't figure out how to fix the code so the "mirroring" will work. Any suggestions?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Error when "mirroring" named ranges between worksheets

    hi fishermanryan, if Sheet1 has MBO_FFV_1 named range and Sheet2 MBO_FFV_2 named range, this works as expected

    Sheet1 code:

    Please Login or Register  to view this content.
    Sheet2 code

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-08-2014
    Location
    Denver, CO
    MS-Off Ver
    2013
    Posts
    7

    Re: Error when "mirroring" named ranges between worksheets

    I agree, the code should be working. However, I'm still having issues.

    If I edit a cell value on Sheet2, the corresponding value is changed on Sheet 1. However, if I edit a cell value on Sheet1, it gives me the mentioned error. I feel pretty confident the code is correct; is there something else that could be creating the error?

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Error when "mirroring" named ranges between worksheets

    can you post a workbook with the coding for testing?

  5. #5
    Registered User
    Join Date
    07-08-2014
    Location
    Denver, CO
    MS-Off Ver
    2013
    Posts
    7

    Re: Error when "mirroring" named ranges between worksheets

    A sample workbook is attached. Any suggestions are appreciated! Book1.xlsm

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Error when "mirroring" named ranges between worksheets

    please check attachment, the codes were missing sheet reference for nonactive sheet named range
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-08-2014
    Location
    Denver, CO
    MS-Off Ver
    2013
    Posts
    7

    Re: Error when "mirroring" named ranges between worksheets

    Curious...
    Your adjusted sheet didn't work on my computer. I tried changing cell values on one sheet or the other and they weren't mirrored (macros are enabled). As a side note, other named ranges in my workbook don't need the sheet specified when trying to mirror, so I'm not sure why this one would be any different.

    Could there be some setting on my computer that I'm not aware of that could be blocking the macro?

    Or, could the fact that I've been making lots of edits and changes to this workbook using named range "MBO_FFV_1" have created some issue?

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Error when "mirroring" named ranges between worksheets

    try to run this code first:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to use named ranges in VBA code using "Columns" and a variation on "Range"
    By haljam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2014, 02:48 PM
  2. Set the "RefersTo" property of Named Ranges
    By m3atball in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-19-2010, 02:51 PM
  3. Mirroring Named Ranges
    By wjcjhwk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-26-2009, 12:49 PM
  4. Replace the name of "Named Ranges"
    By neodjandre in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2008, 02:33 PM
  5. No idea what "Named Ranges" are.
    By Preacher Ted in forum Excel General
    Replies: 4
    Last Post: 08-04-2006, 08:40 AM

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