+ Reply to Thread
Results 1 to 3 of 3

deleting rows screws formulas

  1. #1
    Registered User
    Join Date
    11-03-2006
    Posts
    10

    Question deleting rows screws formulas

    I've written a macro which formats a table in Worksheet 1. Worksheet 2 is full of formulas that reads from Worksheet 1. But when I add a 'remove duplicate rows' process to the macro, it leaves me with rows in Worksheet 2 that are full of errors.

    Maybe to explain better... My workflow is:

    1.Copy data (from external table) into Worksheet1
    2. Run Macro - "FormatTable".
    3. Run Macro "Remove Duplicate Rows"**
    4. Check Worksheet 2

    The duplicate rows that have been deleted from Worksheet 1 are still in Worksheet 2, but with #REF in each cell. Everything is fine in Worksheet2 after step2. It's step3 that ruins it!

    How do I get the 'delete duplicate rows' thing to work on Worksheet2.

    ** I got this from http://www.cpearson.com/excel/duplicat.htm

    cheers!

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,419
    When you delete the rows in worksheet1, Excel tries to update the formulas that referred to the deleted rows, but it has no idea what to refer to, since those rows were simply deleted. What would you like to do? Delete the rows that referred to the deleted rows? Change the formulas so they refer to something else (and what would you like to change them to)? Hide the rows with errors? Something else?

  3. #3
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by wombat323
    I've written a macro which formats a table in Worksheet 1. Worksheet 2 is full of formulas that reads from Worksheet 1. But when I add a 'remove duplicate rows' process to the macro, it leaves me with rows in Worksheet 2 that are full of errors.

    Maybe to explain better... My workflow is:

    1.Copy data (from external table) into Worksheet1
    2. Run Macro - "FormatTable".
    3. Run Macro "Remove Duplicate Rows"**
    4. Check Worksheet 2

    The duplicate rows that have been deleted from Worksheet 1 are still in Worksheet 2, but with #REF in each cell. Everything is fine in Worksheet2 after step2. It's step3 that ruins it!

    How do I get the 'delete duplicate rows' thing to work on Worksheet2.

    ** I got this from http://www.cpearson.com/excel/duplicat.htm

    cheers!
    Is there a reason you cannot remove the duplicates before you Format Table?

    1.Copy data (from external table) into Worksheet1
    3. Run Macro "Remove Duplicate Rows"**
    2. Run Macro - "FormatTable".
    4. Check Worksheet 2

    Or, alternately, can you, in worksheet2, Copy the data, and Paste Special = Values back over itsself

    ---
    Last edited by Bryan Hessey; 11-11-2006 at 08:02 PM.
    Si fractum non sit, noli id reficere.

+ 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