My Assistant
![]()
Custom Search
|
![]() ![]() |
![]() |
![]() Post#1 | |
Posts: 7 Joined: 14-November 18 ![]() | I cannot figure out where my code is wrong and why I keep getting this error on the auto-fill to last row. I want to Enter two formulas into two rows starting from row 10 to the last row. CODE Dim xlApp As Object Dim lRow1 As Long Set xlApp = CreateObject("Excel.Application") With xlApp .Visible = True .Workbooks.Open Filename 'Sheet1 .Sheets("Sheet11").Select .Range("A10").Select .ActiveCell.CopyFromRecordset rstCHR strFormulas(1) = "=SUMIF(Charity_Line20!$A:$A,E10,Charity_Line20!$D:$D)" strFormulas(2) = "=SUMIF(Charity_Line22!$A:$A,E10,Charity_Line22!$G:$G)" lRow1 = .Sheets("Sheet1").Cells(.Rows.Count, "U").End(xlUp).Row .Range("V10:W" & lRow1).AutoFill = strFormulas I have been hat this for a good hour, and I cannot see where I am wrong and it is not working. ![]() |
![]() Post#2 | |
![]() UA Moderator Posts: 76,880 Joined: 19-June 07 From: SunnySandyEggo ![]() | Just FYI... Cross post... -------------------- Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas Access Website | Access Blog | Email |
![]()
Custom Search
|
![]() | Search Top Lo-Fi | 12th December 2019 - 05:35 AM |