View Single Post
 
Old 10-01-2014, 08:33 AM
gebobs gebobs is offline Windows 7 64bit Office 2010 64bit
Expert
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

Gotta admit, my VBA is not what it once was. I take it ActiveCell.FormulaR1C1 requires a text argument. Forget about the result. When you run your code, what is the actual formula that is entered into A17?

It looks like you have a few extraneous characters. Try this...

Range("AI7").Select
ActiveCell.FormulaR1C1 = _
"=COUNTIFS([DPA_ScheduledReport.csv]DPA_ScheduledReport!R[-4]C7:R[9994]C7,""success"",[DPA_ScheduledReport.csv]DPA_ScheduledReport!R[-4]C15:R[9994]C15,"">"" & TODAY()+7/24)"


When you run the code, the formula in A17 then should be:

=COUNTIFS([DPA_ScheduledReport.csv]DPA_ScheduledReport!R[-4]C7:R[9994]C7,"success",[DPA_ScheduledReport.csv]DPA_ScheduledReport!R[-4]C15:R[9994]C15,">" & TODAY()+7/24)
Reply With Quote