+ Reply to Thread
Results 1 to 8 of 8

#REF error when deleting values from a row of concatenated cells.

  1. #1
    Registered User
    Join Date
    11-13-2013
    Location
    Denham Springs, La.
    MS-Off Ver
    Excel 2010
    Posts
    3

    #REF error when deleting values from a row of concatenated cells.

    So here is the problem.

    I have a distribution matrix at work that we use to get email addresses for people who want to receive different types of documents. Emails are listed along the top and doc types are listed along the left side. Where the row and column intersect there is an "E" to indicate that the person would like that type of document. There is a formula next to each doc type that concatenates all of the email addresses that have a corresponding "E" on that row. The problem I am having is that when I delete a column, I revieve the #REF error. I am not the only person using and updating the information in this spreadsheet and can therefore not guarantee that people will not delete columns. When a person is removed from the project, one of the other people will go in and delete the column.

    About a year ago we had a Matrix with a macro that would automatically fix this.

    This is the code for that particular macro

    Please Login or Register  to view this content.
    I would like to modify it for use in the attached example.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: #REF error when deleting values from a row of concatenated cells.

    In your formulas, the use of indirect references will solve your problem. If a formula in cell A5 is referring to a cell in column E on its same row, then Use INDIRECT("E"&ROW()) in place of E5 within the formula. Then when a user deletes column E, the formula will always be referring to E no matter what.
    Last edited by bmxfreedom; 11-13-2013 at 02:25 PM.
    If I helped, please click on Add Reputation.

  3. #3
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: #REF error when deleting values from a row of concatenated cells.

    For instance, you can use:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: #REF error when deleting values from a row of concatenated cells.

    However, I suspect that if you intend to use VBA anyway, these formulas are really bulky and unnecessary because you could just created a macro that loops through all of the columns checking for the value "E", and compiling the addresses into the cell by way of range(address).value = range(address).value & "next email", which can all be determined easily in the code. That would be my suggestion.
    Last edited by bmxfreedom; 11-13-2013 at 03:05 PM.

  5. #5
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: #REF error when deleting values from a row of concatenated cells.

    A simple piece of code that will do what your formulas do is the following:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-13-2013
    Location
    Denham Springs, La.
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: #REF error when deleting values from a row of concatenated cells.

    Thank you so much for the help. The formula is exactly what I have been looking for. I am also testing the macro out in a copy of the matrix. The only thing I have noticed that will prevent me from using it is that it does not replace the info in the email column every time it is run, it just adds to it. Is there a way to have it clear the column before it puts the new info into it? Thank you again for the help, you have no idea how long I have been working on this.

  7. #7
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: #REF error when deleting values from a row of concatenated cells.

    Yeah, that should be simple. Add:
    Please Login or Register  to view this content.
    right after defining rcnt in this line
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-13-2013
    Location
    Denham Springs, La.
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: #REF error when deleting values from a row of concatenated cells.

    This is even better. You are a rock star. Thank you so very much for all the help. This thing has been a pain in the neck to deal with in the past and now I do not see us having any further problems updating it. You are a life saver.

+ 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. [SOLVED] Find count of Unique or Duplicate Values based on Concatenated values in 2 columns
    By bdicarlo1 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-03-2014, 12:42 AM
  2. Replies: 1
    Last Post: 04-30-2012, 12:07 PM
  3. vba to Match concatenated values in concatenated columns
    By bjurick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2012, 03:45 PM
  4. Error Msg When Deleting Cells
    By winnie_shrub in forum Excel General
    Replies: 2
    Last Post: 05-04-2010, 10:32 AM
  5. [SOLVED] Deleting several cells at once causes a VBA error
    By nem in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-02-2006, 10:45 AM

Tags for this Thread

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