+ Reply to Thread
Results 1 to 4 of 4

Delete cell contents without breaking formulas

  1. #1
    Registered User
    Join Date
    02-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Delete cell contents without breaking formulas

    Hi Guys,
    I have a sheet that has data generated on it by button click that calls a macro (thanks Watersev!!). Formulas on other sheets then use this data in a number of ways including producing plots and charts. My problem is that every once in a while someone will wish to clear all the data and enter a new set. So I'm using the following code to clear the cell contents so that new data can be added:

    Please Login or Register  to view this content.
    This certainly clears the cells contents, but it also breaks all of the formula references to the cells where the data used to be.

    So in step-by-step:
    • Sheet starts blank
      Button is pressed and sheet is populated
      On another sheet the tables and charts are populated from the data
      The 'delete' button is pressed and the inital data sheet is cleared
      All formulas that linked to the inital data sheet break and become #REF errors

    Does anyone have any ideas on how to prevent this from happening. I've tried making the formulas INDIRECT as other have said this will work, but it doesnt!
    Last edited by rmf17; 03-01-2012 at 02:31 AM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Delete cell contents without breaking formulas

    Hi

    try using clearcontents instead of delete.

    rylo

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Delete cell contents without breaking formulas

    Have you tried clearcontents instead
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-22-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Delete cell contents without breaking formulas

    Hi,

    Thanks! Works a charm

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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