Updating software formulas on a worksheet

I developed an Excel plugin. It provides three custom Excel application formulas. All of this works great. Now I need to add an update button, which, when clicked, will update only those formulas on the sheet. So, in the button click handler, what code do I need to write?

Using Application.CalculateFull(), I can update all the formulas on the sheet. Is there a way to update only specific formulas in a worksheet, and not the whole worksheet?

+3
source share
2 answers
Range("A3:C5").Calculate 'calculate all the cells from A3 to C5

OR

Range("A3").Calculate  'only calculate cell A3
+2
source

, excel.. 3 (x, y, z) . , . , (, ) . , ?? Application.CalculateFull() . , .

/ (UDF) . , UDF "MyFunction", "MyFunction (" MyFunction (".

, Excel.Application "excelApp", / # :

foreach (Excel.Workbook workbook in excelApp.Workbooks)
{
    foreach (Excel.Worksheet worksheet in workbook.Worksheets)
    {
        worksheet.Cells.Replace(
            "MyFunction(",
            "MyFunction(",
            Excel.XlLookAt.xlPart,
            Excel.XlSearchOrder.xlByRows,
            false,
            Type.Missing,
            Type.Missing,
            Type.Missing);
    }
}

:

(a) (RTD). , , , . " ". , , Find/Replace 100% , RTD . , , . Excel Visual Basic.NET, VB.NET, #, .

(b) MyFunction (x, y, z, Refresh). "", , "", . , , .

(c) Application.CalculateFull(), , , . , ( ) 100% .

, , Find/Replace. , .

-

0

Source: https://habr.com/ru/post/1719629/


All Articles