X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Lastrow Error Object Required, Access 2016    
post Oct 10 2019, 04:18 PM

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.
Dim xlApp As Object
Dim lRow1 As Long
Set xlApp = CreateObject("Excel.Application")

With xlApp
    .Visible = True
    .Workbooks.Open Filename
    .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
Start new topic
post Oct 10 2019, 04:52 PM

UA Moderator
Posts: 77,333
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

Posts in this topic
- jalopez453   Lastrow Error Object Required   Oct 10 2019, 04:18 PM
- - theDBguy   Just FYI... Cross post...   Oct 10 2019, 04:52 PM

Custom Search

RSSSearch   Top   Lo-Fi    23rd January 2020 - 10:23 PM