+ Reply to Thread
Results 1 to 4 of 4

Clear static formulas, but leave linked formulas

  1. #1
    Registered User
    Join Date
    11-13-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    2

    Clear static formulas, but leave linked formulas

    I'd like to find a way to clear everything in a column except for linked range formulas (like: "=sum(A3:A5)")

    Currently I'm using "If cell.HasFormula = False Then cell.ClearContents"

    But I'd like to also remove the data from cells that are calculated with static numbers (like: "=23598+395802+3598")

    Is there a way to delete everything in a column that has static numeric data like this and maintain the linked formulas ("=A3-A5-A7")

    Thank you!

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Clear static formulas, but leave linked formulas

    I think something like:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-13-2013
    Location
    Boston
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Clear static formulas, but leave linked formulas

    Unfortunately this code doesn't seem to do anything when I alter the range to the appropriate data set.

    I've been looking into Precedents now for the past few hours, and everything I've tried does not recognize the difference between static numbers "=158923-16830-269849" vs linked cells (precedents) "=A4-A5-A7"

    Does anyone know how this is done? Can it be done?

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Clear static formulas, but leave linked formulas

    Hi this code worked for me but maybe it is a version thing - in 2003, if the cell has no precedents then
    a = cl.directprecedents
    creates an error for me. If the cell has precedents then
    a = cl.directprecedents.count
    would return the number of linked cells to the variable a.
    Perhaps you could try:
    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. formulas for getting leave brk ups
    By divi123 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-13-2013, 06:14 AM
  2. Clear contents but leave formulas in Excel
    By ojchippy in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 06-16-2006, 11:15 PM
  3. [SOLVED] Static Cell Refrences in Formulas
    By Ben in forum Excel General
    Replies: 4
    Last Post: 12-15-2005, 09:15 PM
  4. Replies: 2
    Last Post: 04-18-2005, 01:06 PM
  5. [SOLVED] Hyperlinks static but formulas are not. Why?
    By Hari in forum Excel General
    Replies: 2
    Last Post: 01-13-2005, 09:06 PM

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