Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello:

I am trying to fill the cells on range B6:H6 down, so I am using Autofill to perform the action. However, I keep getting the error above.

Here is my code:

        Dim eeRefSheets As Excel.Worksheet

        For i As Long = 1 To 3 Step 1

            eeRefSheets = EmployeeSheets(i)

            With eeRefSheets

Dim lngLr As Long = .Cells.Find(What:="*", SearchDirection:=Excel.XlSearchDirection.xlPrevious, SearchOrder:=Excel.XlSearchOrder.xlByRows).Row

                .Range("B6:H6").AutoFill(Destination:=.Range("B6:AH" & lngLr))

            End With

        Next


    End Sub
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900