Formulas inserted by VBA don't calculate until manually opened and confirmed by pressing the Enter key
up vote
-1
down vote
favorite
I encountered this issue while working on a monthly report:
When feeding Range.Formula formulae (any kind of formula) with VBA they don't seem to calculate and show only the text of the formula unless I - open them manually cell-by-cell and hit the Enter key or
1. Find-and-Replace the "=" for "="
2. Do Text to Columns on the data
However, none of this works when I try to do any of these actions programatically through VBA i.e.
1. Find-and-Replace works when replacing the "=" in the formula with anything else but when trying to replace it back it stays unchanged
2. Run Text to Columns with no result
I tried both writing my own functions and recording those actions with macro recorder.
Here is the list of things I tried so far:
- Checking the format of the column I am inserting the data into - it is set to Number
- Setting the data format from Number to General
- Inserting the formulae somewhere else in the document through VBA
- Copying the formulae and inserting it somewhere else on the sheet
- Copying the formulae and inserting it into a different workbook
- Changing the workbook Calculation mode from automatic to manual and back
- Saving the workbook and reopening it
- Forcing recalculation
- Forcing global recalculation
- Setting the Application.Iteration to True
- Setting the Range.Dirty
- Setting ThisWorkbook.ForceFullCalculation to True
- Trying different method of data insertion eg. feeding the range from array to feeding the column row-by-row
- Show formulas is disabled
One thing I have to point out is when I evaluate the formula it says that the formula contains a constant.
Can anybody help me?
Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByVal Destination As Any, ByVal source As Any, ByVal Length As Long)
Function StringRepeatSimple(number As Long, expression As String) As String
Dim expressionLengthBytes As Long
expressionLengthBytes = LenB(expression)
StringRepeatSimple = Space$(number * Len(expression))
Dim bufferPointer As Long
bufferPointer = StrPtr(StringRepeatSimple)
Dim expressionPointer As Long
expressionPointer = StrPtr(expression)
Dim copyCounter As Long
For copyCounter = 0 To number - 1
CopyMemory bufferPointer + copyCounter * expressionLengthBytes, expressionPointer, expressionLengthBytes
Next copyCounter
End Function
Private Sub crtTmpRng(ByVal sumSht As Worksheet, ByVal usdRng As Range)
itmArr = Split("Akvizice,Distribuce,Doplňkové služby,Last Call,Neutilitní činnosti,Nezařazené činnosti,Ostatní činnosti,Přepisy,Retence,RPG,Smlouvy,Tisky,Výpovědi,Změna zák. dat,ŽoP", ",")
For j = LBound(itmArr) To UBound(itmArr)
Set tmpRng = sumSht.Range(sumSht.Cells(Intersect(usdRng, sumSht.Range("A:A")).Find(itmArr(j)).Row, usdRng.Find(MonthName(Month(Now()) - 1, 0)).Offset(1, 0).Column), _
sumSht.Cells(Intersect(usdRng, sumSht.Range("A:A")).Find(itmArr(j) & " Celkem").Row - 1, usdRng.Find(MonthName(Month(Now()) - 1, 0)).Offset(1, 0).Column))
If IsEmpty(mrgdRng) Then Set mrgdRng = tmpRng Else Set mrgdRng = Union(mrgdRng, tmpRng)
Next j
tmpItmArr = Split(Replace(StringRepeatSimple(258, "ß=IF(ISERROR(VLOOKUP($B3;'09_2018'!$B:$F;3;FALSE));""N"";VLOOKUP($B3;'09_2018'!$B:$F;3;FALSE))"), "ß", "", , 1), "ß")
mrgdRng.Formula = tmpItmArr
End Sub
Sub Main()
For Each wbk In Application.Workbooks
If wbk.Name Like "BC_OKP_##_2018*" Then Exit For
Next wbk
If wbk Is Nothing Then Exit Sub
Set sumSht = wbk.Worksheets("Sum2018")
Set usdRng = sumSht.UsedRange
Call crtTmpRng(sumSht, usdRng)
End Sub
excel vba excel-vba excel-formula excel-2013
|
show 8 more comments
up vote
-1
down vote
favorite
I encountered this issue while working on a monthly report:
When feeding Range.Formula formulae (any kind of formula) with VBA they don't seem to calculate and show only the text of the formula unless I - open them manually cell-by-cell and hit the Enter key or
1. Find-and-Replace the "=" for "="
2. Do Text to Columns on the data
However, none of this works when I try to do any of these actions programatically through VBA i.e.
1. Find-and-Replace works when replacing the "=" in the formula with anything else but when trying to replace it back it stays unchanged
2. Run Text to Columns with no result
I tried both writing my own functions and recording those actions with macro recorder.
Here is the list of things I tried so far:
- Checking the format of the column I am inserting the data into - it is set to Number
- Setting the data format from Number to General
- Inserting the formulae somewhere else in the document through VBA
- Copying the formulae and inserting it somewhere else on the sheet
- Copying the formulae and inserting it into a different workbook
- Changing the workbook Calculation mode from automatic to manual and back
- Saving the workbook and reopening it
- Forcing recalculation
- Forcing global recalculation
- Setting the Application.Iteration to True
- Setting the Range.Dirty
- Setting ThisWorkbook.ForceFullCalculation to True
- Trying different method of data insertion eg. feeding the range from array to feeding the column row-by-row
- Show formulas is disabled
One thing I have to point out is when I evaluate the formula it says that the formula contains a constant.
Can anybody help me?
Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByVal Destination As Any, ByVal source As Any, ByVal Length As Long)
Function StringRepeatSimple(number As Long, expression As String) As String
Dim expressionLengthBytes As Long
expressionLengthBytes = LenB(expression)
StringRepeatSimple = Space$(number * Len(expression))
Dim bufferPointer As Long
bufferPointer = StrPtr(StringRepeatSimple)
Dim expressionPointer As Long
expressionPointer = StrPtr(expression)
Dim copyCounter As Long
For copyCounter = 0 To number - 1
CopyMemory bufferPointer + copyCounter * expressionLengthBytes, expressionPointer, expressionLengthBytes
Next copyCounter
End Function
Private Sub crtTmpRng(ByVal sumSht As Worksheet, ByVal usdRng As Range)
itmArr = Split("Akvizice,Distribuce,Doplňkové služby,Last Call,Neutilitní činnosti,Nezařazené činnosti,Ostatní činnosti,Přepisy,Retence,RPG,Smlouvy,Tisky,Výpovědi,Změna zák. dat,ŽoP", ",")
For j = LBound(itmArr) To UBound(itmArr)
Set tmpRng = sumSht.Range(sumSht.Cells(Intersect(usdRng, sumSht.Range("A:A")).Find(itmArr(j)).Row, usdRng.Find(MonthName(Month(Now()) - 1, 0)).Offset(1, 0).Column), _
sumSht.Cells(Intersect(usdRng, sumSht.Range("A:A")).Find(itmArr(j) & " Celkem").Row - 1, usdRng.Find(MonthName(Month(Now()) - 1, 0)).Offset(1, 0).Column))
If IsEmpty(mrgdRng) Then Set mrgdRng = tmpRng Else Set mrgdRng = Union(mrgdRng, tmpRng)
Next j
tmpItmArr = Split(Replace(StringRepeatSimple(258, "ß=IF(ISERROR(VLOOKUP($B3;'09_2018'!$B:$F;3;FALSE));""N"";VLOOKUP($B3;'09_2018'!$B:$F;3;FALSE))"), "ß", "", , 1), "ß")
mrgdRng.Formula = tmpItmArr
End Sub
Sub Main()
For Each wbk In Application.Workbooks
If wbk.Name Like "BC_OKP_##_2018*" Then Exit For
Next wbk
If wbk Is Nothing Then Exit Sub
Set sumSht = wbk.Worksheets("Sum2018")
Set usdRng = sumSht.UsedRange
Call crtTmpRng(sumSht, usdRng)
End Sub
excel vba excel-vba excel-formula excel-2013
I have seen this problem. Are you by any chance using VBA and writing the formulas in your own language? That won't work. You need to use the English formulas and English Excel formula separator (,).
– Andreas
Nov 11 at 14:01
1. Range.Replace "=", "any character goes here" works but Range.Replace "any character goes here", "=" doesn't and the formulae stay untouched eg. !IF.... 2. Range.TextToColumns Destination:=Range("CS3"), DataType:=xlFixedWidth, FieldInfo:=Array(0,1), TrailingMinusNumbers:=True does nothing even though that's the exact same code recorded by macro recorder
– Wutdahug3
Nov 11 at 14:03
@Andreas I am not. Both my code and formulae are in English. The file however was made in Czech locale. I tried changing the formula from semicolons to commas but no dice. Now when I enter the formula manually I get the "We found a problem with this formula..." warning box.
– Wutdahug3
Nov 11 at 14:19
@Wutdahug3 I use Czech local settings as well and I've never no had this issue, if you believe the problem is actually not related to your code, you should probably go to SuperUser instead as that's where we deal with program related issues, if you're not sure and you think the problem might be in the code itself please edit your question with your code.
– M.Douda
Nov 11 at 14:38
If it is the workings of Excel that are the problem, not the code, from a debugging perspective you would be better to start with the simplest possible function and move on from there.
– RichardBJ
Nov 11 at 14:55
|
show 8 more comments
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I encountered this issue while working on a monthly report:
When feeding Range.Formula formulae (any kind of formula) with VBA they don't seem to calculate and show only the text of the formula unless I - open them manually cell-by-cell and hit the Enter key or
1. Find-and-Replace the "=" for "="
2. Do Text to Columns on the data
However, none of this works when I try to do any of these actions programatically through VBA i.e.
1. Find-and-Replace works when replacing the "=" in the formula with anything else but when trying to replace it back it stays unchanged
2. Run Text to Columns with no result
I tried both writing my own functions and recording those actions with macro recorder.
Here is the list of things I tried so far:
- Checking the format of the column I am inserting the data into - it is set to Number
- Setting the data format from Number to General
- Inserting the formulae somewhere else in the document through VBA
- Copying the formulae and inserting it somewhere else on the sheet
- Copying the formulae and inserting it into a different workbook
- Changing the workbook Calculation mode from automatic to manual and back
- Saving the workbook and reopening it
- Forcing recalculation
- Forcing global recalculation
- Setting the Application.Iteration to True
- Setting the Range.Dirty
- Setting ThisWorkbook.ForceFullCalculation to True
- Trying different method of data insertion eg. feeding the range from array to feeding the column row-by-row
- Show formulas is disabled
One thing I have to point out is when I evaluate the formula it says that the formula contains a constant.
Can anybody help me?
Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByVal Destination As Any, ByVal source As Any, ByVal Length As Long)
Function StringRepeatSimple(number As Long, expression As String) As String
Dim expressionLengthBytes As Long
expressionLengthBytes = LenB(expression)
StringRepeatSimple = Space$(number * Len(expression))
Dim bufferPointer As Long
bufferPointer = StrPtr(StringRepeatSimple)
Dim expressionPointer As Long
expressionPointer = StrPtr(expression)
Dim copyCounter As Long
For copyCounter = 0 To number - 1
CopyMemory bufferPointer + copyCounter * expressionLengthBytes, expressionPointer, expressionLengthBytes
Next copyCounter
End Function
Private Sub crtTmpRng(ByVal sumSht As Worksheet, ByVal usdRng As Range)
itmArr = Split("Akvizice,Distribuce,Doplňkové služby,Last Call,Neutilitní činnosti,Nezařazené činnosti,Ostatní činnosti,Přepisy,Retence,RPG,Smlouvy,Tisky,Výpovědi,Změna zák. dat,ŽoP", ",")
For j = LBound(itmArr) To UBound(itmArr)
Set tmpRng = sumSht.Range(sumSht.Cells(Intersect(usdRng, sumSht.Range("A:A")).Find(itmArr(j)).Row, usdRng.Find(MonthName(Month(Now()) - 1, 0)).Offset(1, 0).Column), _
sumSht.Cells(Intersect(usdRng, sumSht.Range("A:A")).Find(itmArr(j) & " Celkem").Row - 1, usdRng.Find(MonthName(Month(Now()) - 1, 0)).Offset(1, 0).Column))
If IsEmpty(mrgdRng) Then Set mrgdRng = tmpRng Else Set mrgdRng = Union(mrgdRng, tmpRng)
Next j
tmpItmArr = Split(Replace(StringRepeatSimple(258, "ß=IF(ISERROR(VLOOKUP($B3;'09_2018'!$B:$F;3;FALSE));""N"";VLOOKUP($B3;'09_2018'!$B:$F;3;FALSE))"), "ß", "", , 1), "ß")
mrgdRng.Formula = tmpItmArr
End Sub
Sub Main()
For Each wbk In Application.Workbooks
If wbk.Name Like "BC_OKP_##_2018*" Then Exit For
Next wbk
If wbk Is Nothing Then Exit Sub
Set sumSht = wbk.Worksheets("Sum2018")
Set usdRng = sumSht.UsedRange
Call crtTmpRng(sumSht, usdRng)
End Sub
excel vba excel-vba excel-formula excel-2013
I encountered this issue while working on a monthly report:
When feeding Range.Formula formulae (any kind of formula) with VBA they don't seem to calculate and show only the text of the formula unless I - open them manually cell-by-cell and hit the Enter key or
1. Find-and-Replace the "=" for "="
2. Do Text to Columns on the data
However, none of this works when I try to do any of these actions programatically through VBA i.e.
1. Find-and-Replace works when replacing the "=" in the formula with anything else but when trying to replace it back it stays unchanged
2. Run Text to Columns with no result
I tried both writing my own functions and recording those actions with macro recorder.
Here is the list of things I tried so far:
- Checking the format of the column I am inserting the data into - it is set to Number
- Setting the data format from Number to General
- Inserting the formulae somewhere else in the document through VBA
- Copying the formulae and inserting it somewhere else on the sheet
- Copying the formulae and inserting it into a different workbook
- Changing the workbook Calculation mode from automatic to manual and back
- Saving the workbook and reopening it
- Forcing recalculation
- Forcing global recalculation
- Setting the Application.Iteration to True
- Setting the Range.Dirty
- Setting ThisWorkbook.ForceFullCalculation to True
- Trying different method of data insertion eg. feeding the range from array to feeding the column row-by-row
- Show formulas is disabled
One thing I have to point out is when I evaluate the formula it says that the formula contains a constant.
Can anybody help me?
Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByVal Destination As Any, ByVal source As Any, ByVal Length As Long)
Function StringRepeatSimple(number As Long, expression As String) As String
Dim expressionLengthBytes As Long
expressionLengthBytes = LenB(expression)
StringRepeatSimple = Space$(number * Len(expression))
Dim bufferPointer As Long
bufferPointer = StrPtr(StringRepeatSimple)
Dim expressionPointer As Long
expressionPointer = StrPtr(expression)
Dim copyCounter As Long
For copyCounter = 0 To number - 1
CopyMemory bufferPointer + copyCounter * expressionLengthBytes, expressionPointer, expressionLengthBytes
Next copyCounter
End Function
Private Sub crtTmpRng(ByVal sumSht As Worksheet, ByVal usdRng As Range)
itmArr = Split("Akvizice,Distribuce,Doplňkové služby,Last Call,Neutilitní činnosti,Nezařazené činnosti,Ostatní činnosti,Přepisy,Retence,RPG,Smlouvy,Tisky,Výpovědi,Změna zák. dat,ŽoP", ",")
For j = LBound(itmArr) To UBound(itmArr)
Set tmpRng = sumSht.Range(sumSht.Cells(Intersect(usdRng, sumSht.Range("A:A")).Find(itmArr(j)).Row, usdRng.Find(MonthName(Month(Now()) - 1, 0)).Offset(1, 0).Column), _
sumSht.Cells(Intersect(usdRng, sumSht.Range("A:A")).Find(itmArr(j) & " Celkem").Row - 1, usdRng.Find(MonthName(Month(Now()) - 1, 0)).Offset(1, 0).Column))
If IsEmpty(mrgdRng) Then Set mrgdRng = tmpRng Else Set mrgdRng = Union(mrgdRng, tmpRng)
Next j
tmpItmArr = Split(Replace(StringRepeatSimple(258, "ß=IF(ISERROR(VLOOKUP($B3;'09_2018'!$B:$F;3;FALSE));""N"";VLOOKUP($B3;'09_2018'!$B:$F;3;FALSE))"), "ß", "", , 1), "ß")
mrgdRng.Formula = tmpItmArr
End Sub
Sub Main()
For Each wbk In Application.Workbooks
If wbk.Name Like "BC_OKP_##_2018*" Then Exit For
Next wbk
If wbk Is Nothing Then Exit Sub
Set sumSht = wbk.Worksheets("Sum2018")
Set usdRng = sumSht.UsedRange
Call crtTmpRng(sumSht, usdRng)
End Sub
excel vba excel-vba excel-formula excel-2013
excel vba excel-vba excel-formula excel-2013
edited Nov 11 at 15:36
asked Nov 11 at 13:38
Wutdahug3
12
12
I have seen this problem. Are you by any chance using VBA and writing the formulas in your own language? That won't work. You need to use the English formulas and English Excel formula separator (,).
– Andreas
Nov 11 at 14:01
1. Range.Replace "=", "any character goes here" works but Range.Replace "any character goes here", "=" doesn't and the formulae stay untouched eg. !IF.... 2. Range.TextToColumns Destination:=Range("CS3"), DataType:=xlFixedWidth, FieldInfo:=Array(0,1), TrailingMinusNumbers:=True does nothing even though that's the exact same code recorded by macro recorder
– Wutdahug3
Nov 11 at 14:03
@Andreas I am not. Both my code and formulae are in English. The file however was made in Czech locale. I tried changing the formula from semicolons to commas but no dice. Now when I enter the formula manually I get the "We found a problem with this formula..." warning box.
– Wutdahug3
Nov 11 at 14:19
@Wutdahug3 I use Czech local settings as well and I've never no had this issue, if you believe the problem is actually not related to your code, you should probably go to SuperUser instead as that's where we deal with program related issues, if you're not sure and you think the problem might be in the code itself please edit your question with your code.
– M.Douda
Nov 11 at 14:38
If it is the workings of Excel that are the problem, not the code, from a debugging perspective you would be better to start with the simplest possible function and move on from there.
– RichardBJ
Nov 11 at 14:55
|
show 8 more comments
I have seen this problem. Are you by any chance using VBA and writing the formulas in your own language? That won't work. You need to use the English formulas and English Excel formula separator (,).
– Andreas
Nov 11 at 14:01
1. Range.Replace "=", "any character goes here" works but Range.Replace "any character goes here", "=" doesn't and the formulae stay untouched eg. !IF.... 2. Range.TextToColumns Destination:=Range("CS3"), DataType:=xlFixedWidth, FieldInfo:=Array(0,1), TrailingMinusNumbers:=True does nothing even though that's the exact same code recorded by macro recorder
– Wutdahug3
Nov 11 at 14:03
@Andreas I am not. Both my code and formulae are in English. The file however was made in Czech locale. I tried changing the formula from semicolons to commas but no dice. Now when I enter the formula manually I get the "We found a problem with this formula..." warning box.
– Wutdahug3
Nov 11 at 14:19
@Wutdahug3 I use Czech local settings as well and I've never no had this issue, if you believe the problem is actually not related to your code, you should probably go to SuperUser instead as that's where we deal with program related issues, if you're not sure and you think the problem might be in the code itself please edit your question with your code.
– M.Douda
Nov 11 at 14:38
If it is the workings of Excel that are the problem, not the code, from a debugging perspective you would be better to start with the simplest possible function and move on from there.
– RichardBJ
Nov 11 at 14:55
I have seen this problem. Are you by any chance using VBA and writing the formulas in your own language? That won't work. You need to use the English formulas and English Excel formula separator (,).
– Andreas
Nov 11 at 14:01
I have seen this problem. Are you by any chance using VBA and writing the formulas in your own language? That won't work. You need to use the English formulas and English Excel formula separator (,).
– Andreas
Nov 11 at 14:01
1. Range.Replace "=", "any character goes here" works but Range.Replace "any character goes here", "=" doesn't and the formulae stay untouched eg. !IF.... 2. Range.TextToColumns Destination:=Range("CS3"), DataType:=xlFixedWidth, FieldInfo:=Array(0,1), TrailingMinusNumbers:=True does nothing even though that's the exact same code recorded by macro recorder
– Wutdahug3
Nov 11 at 14:03
1. Range.Replace "=", "any character goes here" works but Range.Replace "any character goes here", "=" doesn't and the formulae stay untouched eg. !IF.... 2. Range.TextToColumns Destination:=Range("CS3"), DataType:=xlFixedWidth, FieldInfo:=Array(0,1), TrailingMinusNumbers:=True does nothing even though that's the exact same code recorded by macro recorder
– Wutdahug3
Nov 11 at 14:03
@Andreas I am not. Both my code and formulae are in English. The file however was made in Czech locale. I tried changing the formula from semicolons to commas but no dice. Now when I enter the formula manually I get the "We found a problem with this formula..." warning box.
– Wutdahug3
Nov 11 at 14:19
@Andreas I am not. Both my code and formulae are in English. The file however was made in Czech locale. I tried changing the formula from semicolons to commas but no dice. Now when I enter the formula manually I get the "We found a problem with this formula..." warning box.
– Wutdahug3
Nov 11 at 14:19
@Wutdahug3 I use Czech local settings as well and I've never no had this issue, if you believe the problem is actually not related to your code, you should probably go to SuperUser instead as that's where we deal with program related issues, if you're not sure and you think the problem might be in the code itself please edit your question with your code.
– M.Douda
Nov 11 at 14:38
@Wutdahug3 I use Czech local settings as well and I've never no had this issue, if you believe the problem is actually not related to your code, you should probably go to SuperUser instead as that's where we deal with program related issues, if you're not sure and you think the problem might be in the code itself please edit your question with your code.
– M.Douda
Nov 11 at 14:38
If it is the workings of Excel that are the problem, not the code, from a debugging perspective you would be better to start with the simplest possible function and move on from there.
– RichardBJ
Nov 11 at 14:55
If it is the workings of Excel that are the problem, not the code, from a debugging perspective you would be better to start with the simplest possible function and move on from there.
– RichardBJ
Nov 11 at 14:55
|
show 8 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
This is more a SuperUser rather than a StackOverflow response.
Try a Ctrl-Shift-Alt-F9
combination or Application.CalculateFullRebuild
. I have had this issue - this action rebuilds all the dependencies in the workbook.
In our template workbook we have installed a button on the menu page as an "emergency reset" if code and formula stop working. Application.CalculateFullRebuild
is one of the commands that is run from that button.
Tried it, it's not just that particular workbook - this applies to every workbook as I found out.
– Wutdahug3
Nov 11 at 19:08
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
This is more a SuperUser rather than a StackOverflow response.
Try a Ctrl-Shift-Alt-F9
combination or Application.CalculateFullRebuild
. I have had this issue - this action rebuilds all the dependencies in the workbook.
In our template workbook we have installed a button on the menu page as an "emergency reset" if code and formula stop working. Application.CalculateFullRebuild
is one of the commands that is run from that button.
Tried it, it's not just that particular workbook - this applies to every workbook as I found out.
– Wutdahug3
Nov 11 at 19:08
add a comment |
up vote
0
down vote
This is more a SuperUser rather than a StackOverflow response.
Try a Ctrl-Shift-Alt-F9
combination or Application.CalculateFullRebuild
. I have had this issue - this action rebuilds all the dependencies in the workbook.
In our template workbook we have installed a button on the menu page as an "emergency reset" if code and formula stop working. Application.CalculateFullRebuild
is one of the commands that is run from that button.
Tried it, it's not just that particular workbook - this applies to every workbook as I found out.
– Wutdahug3
Nov 11 at 19:08
add a comment |
up vote
0
down vote
up vote
0
down vote
This is more a SuperUser rather than a StackOverflow response.
Try a Ctrl-Shift-Alt-F9
combination or Application.CalculateFullRebuild
. I have had this issue - this action rebuilds all the dependencies in the workbook.
In our template workbook we have installed a button on the menu page as an "emergency reset" if code and formula stop working. Application.CalculateFullRebuild
is one of the commands that is run from that button.
This is more a SuperUser rather than a StackOverflow response.
Try a Ctrl-Shift-Alt-F9
combination or Application.CalculateFullRebuild
. I have had this issue - this action rebuilds all the dependencies in the workbook.
In our template workbook we have installed a button on the menu page as an "emergency reset" if code and formula stop working. Application.CalculateFullRebuild
is one of the commands that is run from that button.
answered Nov 11 at 19:02
AJD
1,2952313
1,2952313
Tried it, it's not just that particular workbook - this applies to every workbook as I found out.
– Wutdahug3
Nov 11 at 19:08
add a comment |
Tried it, it's not just that particular workbook - this applies to every workbook as I found out.
– Wutdahug3
Nov 11 at 19:08
Tried it, it's not just that particular workbook - this applies to every workbook as I found out.
– Wutdahug3
Nov 11 at 19:08
Tried it, it's not just that particular workbook - this applies to every workbook as I found out.
– Wutdahug3
Nov 11 at 19:08
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53249307%2fformulas-inserted-by-vba-dont-calculate-until-manually-opened-and-confirmed-by%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I have seen this problem. Are you by any chance using VBA and writing the formulas in your own language? That won't work. You need to use the English formulas and English Excel formula separator (,).
– Andreas
Nov 11 at 14:01
1. Range.Replace "=", "any character goes here" works but Range.Replace "any character goes here", "=" doesn't and the formulae stay untouched eg. !IF.... 2. Range.TextToColumns Destination:=Range("CS3"), DataType:=xlFixedWidth, FieldInfo:=Array(0,1), TrailingMinusNumbers:=True does nothing even though that's the exact same code recorded by macro recorder
– Wutdahug3
Nov 11 at 14:03
@Andreas I am not. Both my code and formulae are in English. The file however was made in Czech locale. I tried changing the formula from semicolons to commas but no dice. Now when I enter the formula manually I get the "We found a problem with this formula..." warning box.
– Wutdahug3
Nov 11 at 14:19
@Wutdahug3 I use Czech local settings as well and I've never no had this issue, if you believe the problem is actually not related to your code, you should probably go to SuperUser instead as that's where we deal with program related issues, if you're not sure and you think the problem might be in the code itself please edit your question with your code.
– M.Douda
Nov 11 at 14:38
If it is the workings of Excel that are the problem, not the code, from a debugging perspective you would be better to start with the simplest possible function and move on from there.
– RichardBJ
Nov 11 at 14:55