View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Nicole Seibert Nicole Seibert is offline
external usenet poster
 
Posts: 60
Default formula not showing up

I think I am in love with Tom... mentally of course.

"Tom Ogilvy" wrote:

Sub abc()
Dim LastCell As Long
LastCell = Cells(Rows.Count, 1).End(xlUp).Offset(-3, 0).Row
Range("H2").Select
ActiveCell.FormulaR1C1 = _
"=SUMPRODUCT(COUNTIF(RC[1],{""*MILLERSTEVENM*"",""*PISCOPOGINA*"",""*LASKAAN THO*"",""*NELSONBECKY*""})*{1,2,3,4})"
Selection.AutoFill Destination:=Range("H2:H" & LastCell),
Type:=xlFillDefault

End Sub

worked for me.

--
Regards,
Tom Ogilvy


"Nicole Seibert" wrote:

I ask a question about this code earlier and that question was answered. Now
I have a new one:
Why doesn't the formula autofill?

Here is the code:
Dim LastCell As Long
LastCell = Cells(Rows.Count, 1).End(xlUp).Offset(-3, 0).Row
Range("H2").Select
ActiveCell.FormulaR1C1 = _

"=SUMPRODUCT(COUNTIF(RC[1],{""*MILLERSTEVENM*"",""*PISCOPOGINA*"",""*LASKAAN THO*"",""*NELSONBECKY*""})*{1,2,3,4})"
Range("H3").Select
ActiveCell.FormulaR1C1 = _

"=SUMPRODUCT(COUNTIF(RC[1],{""*MILLERSTEVENM*"",""*PISCOPOGINA*"",""*LASKAAN THO*"",""*NELSONBECKY*""})*{1,2,3,4})"
Range("H2:H3").Select
Selection.Copy
Range("H4:H" & LastCell).Select
Selection.AutoFill Destination:=Range("H4:H" & LastCell),
Type:=xlFillDefault

Thanks,
Nicole