Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Typing vs VBA
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Peter T, post: 6387061"] OK I get the error you mentioned, start by rearranging like this - Sub test() Dim sFmla As String Dim rCell As Range Set rCell = Range("I2") sFmla = "=IF(INDIRECT(""RC8"", FALSE)=""Auto No Run"", IF(GETPIVOTDATA(""Comp Status"", TCCompositionAnalysis!$A$3, ""TC ID"", INDIRECT(""RC1"", FALSE), ""Comp Status"", ""Error"", ""ManAuto"", ""Auto""), ""Auto Error"", IF(GETPIVOTDATA(""Comp Status"", TCCompositionAnalysis!$A$3, ""TC ID"", INDIRECT(""RC1"", FALSE), ""Comp Status"", ""UnDev"", ""ManAuto"", ""Auto"")>0, ""Auto UnDev"", IF(GETPIVOTDATA(""Comp Status"", TCCompositionAnalysis!$A$3, ""TC ID"", INDIRECT(""RC1"", FALSE), ""Comp Status"", ""Maint"", ""ManAuto"", ""Auto"")>0, ""Auto Maint"", ""Eval This Row""))), IF(INDIRECT(""RC8"", FALSE)=""Run Auto"", """", """"))" rCell.Formula = sFmla End Sub The formula is the same as yours though you'll probably need to unwrap The main change is Formula vs your FormulaR1C1 That at least enables the formula to be entered though I have no idea if it will give the correct result, it's impossible for me to recreate your workbook. At a glance though "RC8" & RC1 don't look right, would expect a numeral after the R. Notice there's no need to 'Select' the cell (you'd need to qualify it further if it's not on the activesheet) You didn't need Option Explicit as you didn't use any variables. But if you use them, as in my example, best to head the module with Option Explicit, ie include it at the top of the module. Regards, Peter T [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Typing vs VBA
Top