Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autosum automatically enters zero | Excel Worksheet Functions | |||
Running a Macro that enters a function that returns #VALUE! | Excel Discussion (Misc queries) | |||
Date enters wrong #'s | New Users to Excel | |||
find/replace enters | Excel Discussion (Misc queries) | |||
Macro that hide or unhide and not calculate or calculate | Excel Programming |