UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Lastrow Error Object Required, Access 2016    
 
   
jalopez453
post Oct 10 2019, 04:18 PM
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. frown.gif
Go to the top of the page
 
theDBguy
post Oct 10 2019, 04:52 PM
Post#2


Access Wiki and Forums Moderator
Posts: 76,579
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
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    19th November 2019 - 08:53 AM