Excel VBA formula calculation problem summary

Source: Internet
Author: User

First of all, we recommend a very good Excel programming learning site: http://club.excelhome.net/

Problem Background: Recently, my colleagues encountered two problems, which are described as follows.

Scenario 1: Excel tool. A cell is a complex formula, which is derived from data in other worksheets and calls a custom function. When the value of the data source is changed, the value of the cell in the formula changes to # Value !, Select the formula cell and press enter to find that the value of the formula cell is correct. The problem is inevitable.

Scenario 2: Use the VB tool to query and compute part of the data, and fill in the data source in the Excel template file. The Excel Formula cell is also a complex formula. When the data source is filled, the calculation result of the formula cell is automatically updated. However, when VB reads the Excel file, it finds that the value of the formula cell is # Value !. If you use VB to call the workbook and save it, then you can obtain the value of the cell in the formula.

To address the above two problems, I cannot solve them. After searching and sorting on the Excel learning website, the basic solution is as follows:

1. Make sure that the automatic calculation option in Excel is selected.

2. Try to change the format of the formula cell to regular.

3. Try to select all cells in all worksheets and set the format to regular.

4. Use the VBA code to modify the formula .... Fm = cell. formula, cell. formula = FM...

5. search and replace: replace all "=" search with "= ". Similar to function 4, the formula is refreshed.

6. Fixed the Excel file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.