ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro enters formula but it won't calculate! (https://www.excelbanter.com/excel-programming/350571-macro-enters-formula-but-wont-calculate.html)

James Kendall

Macro enters formula but it won't calculate!
 
Sub FORMULA()
'
' FORMULA Macro
' Macro recorded 1/16/2006 by E127232 (James Kendall)
'
ActiveCell.FormulaR1C1 =
"=IF(AND(OR(CODE(B2)<47,CODE(B2)58),RIGHT(B2,1)=" "X"",LEN(B2)=6),CONCATENATE(0,B2),IF(AND(LEN(B2)=5 ,CODE(B2)47,CODE(B2)<58,RIGHT(B2,1)<""X"",ISERRO R(FIND(""-"",B2))),CONCATENATE(0,B2),B2))"
Range("A2").Select
End Sub

This above gives me the following in a cell. I need it to calculate instead.
=IF(AND(OR(CODE(B2)<47,CODE(B2)58),RIGHT(B2,1)="X ",LEN(B2)=6),CONCATENATE(0,B2),IF(AND(LEN(B2)=5,CO DE(B2)47,CODE(B2)<58,RIGHT(B2,1)<"X",ISERROR(FIN D("-",B2))),CONCATENATE(0,B2),B2))

Am I missing something?
--
Thank you for your time.
Windows XP
Office 2002

Zack Barresse[_3_]

Macro enters formula but it won't calculate!
 
Hello James,

What exactly is showing in the cell? Is it just not calculating? Press F9
to check. If it calculates pressing that key, you may have calculation set
to manual (Tools | Options | Calculation | Automatic). And take "Formula
R1C1" and change to "Formula".

HTH

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)
To email, remove the NO SPAM. Please keep correspondence to the board, as
to benefit others.


"James Kendall" wrote in message
...
Sub FORMULA()
'
' FORMULA Macro
' Macro recorded 1/16/2006 by E127232 (James Kendall)
'
ActiveCell.FormulaR1C1 =
"=IF(AND(OR(CODE(B2)<47,CODE(B2)58),RIGHT(B2,1)=" "X"",LEN(B2)=6),CONCATENATE(0,B2),IF(AND(LEN(B2)=5 ,CODE(B2)47,CODE(B2)<58,RIGHT(B2,1)<""X"",ISERRO R(FIND(""-"",B2))),CONCATENATE(0,B2),B2))"
Range("A2").Select
End Sub

This above gives me the following in a cell. I need it to calculate
instead.
=IF(AND(OR(CODE(B2)<47,CODE(B2)58),RIGHT(B2,1)="X ",LEN(B2)=6),CONCATENATE(0,B2),IF(AND(LEN(B2)=5,CO DE(B2)47,CODE(B2)<58,RIGHT(B2,1)<"X",ISERROR(FIN D("-",B2))),CONCATENATE(0,B2),B2))

Am I missing something?
--
Thank you for your time.
Windows XP
Office 2002




Bob Phillips[_6_]

Macro enters formula but it won't calculate!
 
Do you mean that you want

ActiveCell.Value = Activesheet.Evaluate( _
"=IF(AND(OR(CODE(B2)<47,CODE(B2)58),RIGHT(B2,1)=" "X"",LEN(B2)=6),CONCATENAT
E(0,B2),IF(AND(LEN(B2)=5,CODE(B2)47,CODE(B2)<58,R IGHT(B2,1)<""X"",ISERROR(
FIND(""-"",B2))),CONCATENATE(0,B2),B2))")


--
HTH

RP
"Zack Barresse" wrote in message
...
Hello James,

What exactly is showing in the cell? Is it just not calculating? Press

F9
to check. If it calculates pressing that key, you may have calculation

set
to manual (Tools | Options | Calculation | Automatic). And take "Formula
R1C1" and change to "Formula".

HTH

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)
To email, remove the NO SPAM. Please keep correspondence to the board, as
to benefit others.


"James Kendall" wrote in message
...
Sub FORMULA()
'
' FORMULA Macro
' Macro recorded 1/16/2006 by E127232 (James Kendall)
'
ActiveCell.FormulaR1C1 =

"=IF(AND(OR(CODE(B2)<47,CODE(B2)58),RIGHT(B2,1)=" "X"",LEN(B2)=6),CONCATENAT
E(0,B2),IF(AND(LEN(B2)=5,CODE(B2)47,CODE(B2)<58,R IGHT(B2,1)<""X"",ISERROR(
FIND(""-"",B2))),CONCATENATE(0,B2),B2))"
Range("A2").Select
End Sub

This above gives me the following in a cell. I need it to calculate
instead.

=IF(AND(OR(CODE(B2)<47,CODE(B2)58),RIGHT(B2,1)="X ",LEN(B2)=6),CONCATENATE(0
,B2),IF(AND(LEN(B2)=5,CODE(B2)47,CODE(B2)<58,RIGH T(B2,1)<"X",ISERROR(FIND(
"-",B2))),CONCATENATE(0,B2),B2))

Am I missing something?
--
Thank you for your time.
Windows XP
Office 2002






James Kendall

Macro enters formula but it won't calculate!
 
Sorry guys. Evidently I was missing something (my brain).
I used formatting of Text to Columns earlier. It inserted the formula as a
text string due the the formatting. Once I had the macro reformat the text
to general everything worked fine.
--
Thank you for your time.
Windows XP
Office 2002



All times are GMT +1. The time now is 10:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com