I calculate the formulas in different sheets using:
Sub Calculate_Formulas_otherSheets()
Dim Sheet As Worksheet
For Each Sheet In ActiveWorkbook.Sheets
If Sheet.Name Like "*" & strSearch & "_A" Then
Sheets(Sheet.Name).Calculate
End If
Next
For Each Sheet In ActiveWorkbook.Sheets
If Sheet.Name Like "*" & strSearch & "_B" Then
Sheets(Sheet.Name).Calculate
End If
Next
End Sub
in these sheets, three of the formulas are in merged cells.
formula 1 in AY3
=RIGHT(CELL("filename");LEN(CELL("filename"))-FIND("]";CELL("filename")))
formula 2 in AZ3
=IFERROR(RIGHT(LEFT($AY3;FIND("_";$AY3)-4);2);"")
formula 3 in BA3
=IFERROR(RIGHT(LEFT($AY3;FIND("_";$AY3)-3);1);"")
everything works perfect if i calculate them manually. But when I do it via the above code, they don't get calculated; other formulas in the sheets do get calculated except these three.
What is going wrong?
By the way, the automatic calculation is off.
UPDATE
actually it gets updated in a wrong way: the filename formula gets the sheet name of the sheet in which this vba code is saved as a macro button. How to fix it?
calculate
? Does it work then? – RaystafarianCELL
function, otherwise the information specified in theinfo_type
argument is returned for the last cell that was changed. – GSerg