+ Reply to Thread
Results 1 to 4 of 4

HELP!!! Formula removed after DataRange refresh

  1. #1
    Registered User
    Join Date
    01-20-2007
    Posts
    2

    Angry HELP!!! Formula removed after DataRange refresh

    Hi

    I have an unexplained behaviour in Excel. I am trying to create a report. I use a Data Query and add to it some columns with formulas. If the quesry returns with the results, the formulas work fine and show results. If the query returns with empty result, Excel suddenly removes the formulas from all the columns and never recovers it, it brakes the report. What can I do to make formulas stay even if Data Query returned with empty result?

    Thanks a lot

  2. #2
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    After you have the equations where you want them, do the following:
    1. select a cell that DOES NOT have a formula in it
    2. if there is more than one sheet in the workbook, select a different sheet
    3. turn on the macro recorder (Tools >> Macro >> Record New Macro). This opens a dialog box allowing you to pick a name and a short-cut key. These are not that important.
    4. go back to the sheet with the formulas
    5. one at a time, select each cell with a formula in it (unless they are all the same and all you have to do is drag them down)
    6. when you select a cell, press F2, then press Enter
    7. repeat steps 5 & 6 until you have selected every formula that matters
    8. turn off the macro recorder (Tools >> Macro >> Stop Recording)

    Now you never have to worry about losing the formulas again. If they get lost, just press Alt + F8 (or if you forget, select Tools >> Macro >> Macros, pick the macro you recorded and click "run").

    If you are ever interested in seeing what you recorded, use Tools >> Macro >> Macros and select "Edit".

  3. #3
    Registered User
    Join Date
    01-20-2007
    Posts
    2

    Does not help

    I need the formulas stay without pressing buttons to return them because this report is automatically created by our software on the server. Need a way to fix this behaviour so the formulas stay there.

  4. #4
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203

    It does if you know how to use it

    Tie the macro above to a worksheet change event procedure and it will run automatically whenever the query updates.

+ 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