Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autosum automatically enters zero Sally Excel Worksheet Functions 4 March 1st 09 05:45 PM
Running a Macro that enters a function that returns #VALUE! gevew Excel Discussion (Misc queries) 3 December 29th 06 08:34 PM
Date enters wrong #'s Frustrated_rich99 New Users to Excel 2 December 7th 06 01:06 PM
find/replace enters search Excel Discussion (Misc queries) 2 January 31st 06 08:24 PM
Macro that hide or unhide and not calculate or calculate Jonsson Excel Programming 1 August 19th 03 04:22 PM


All times are GMT +1. The time now is 07:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Đ2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"