Cant seem to get the Autofill syntax correct

JeffGrant

Well-known Member
Joined
Apr 7, 2021
Messages
558
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I can't seem to get the syntax correct on this one.

I have a table of some 20,000 rows and growing daily.

When I add data from another spot, it fills columns A to G, no problem. Then I have to copy the formulas in columns H to J to the last row in the appended data set.

I can select the last row of data in columns H to J easy enough with

Range("R3").End(xlDown).Select
Range(ActiveCell, ActiveCell.Offset(0, 2)).Select

But then I can't get the Autofill to work with this line

Selection.AutoFill Destination:=ActiveCell.Range(ActiveCell, ActiveCell.Offset(0, 2).End(xlDown)), Type:=xlFillDefault

Can somebody please tell the correct synatx for the autofill line.

Thanks

Book1
ABCDEFGHIJK
1Horse NameDateCourseDistanceConditionClassTimeDayStateTrack LocationRace N#
2Rikibobby44352Adelaide River1200GoodBM5401:08.1505/06/2021NTCountry
3Kronos44352Adelaide River1200GoodBM7201:07.6205/06/2021NTCountry
4Huckleberry44352Adelaide River1200GoodMdn01:08.4105/06/2021NTCountry
5Highly Decorated44352Adelaide River1600GoodOpen01:36.8205/06/2021NTCountry
6Highly Decorated44322Adelaide River1600GoodOpen01:36.8206/05/2021NTCountry
7Familja44352Adelaide River1000GoodRST5800:57.7605/06/2021NTCountry
8Floreat Pica44352Adelaide River1600GoodRST6401:37.11
9Rikibobby44352Adelaide River1200GoodBM5401:08.15
10Kronos44352Adelaide River1200GoodBM7201:07.62
11Floreat Pica44352Adelaide River1600GoodRST6401:37.11
Sheet1
Cell Formulas
RangeFormula
H2:H7H2=IF(B2="","",B2)
I2:I7I2=VLOOKUP(C2,'New Ponies.xlsm'!RaceCourse[#Data],2,FALSE)
J2:J7J2=VLOOKUP(C2,'New Ponies.xlsm'!RaceCourse[#Data],3,FALSE)
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
How about
VBA Code:
Sub JeffGrant()
   Dim UsdRws As Long
   UsdRws = Range("A" & Rows.Count).End(xlUp).Row
   Range(Range("H" & Rows.Count).End(xlUp), Range("H" & UsdRws)).Resize(, 3).FillDown
End Sub
 
Upvote 0
Solution
Hi Fluff.....

That will do me absolutely perfectly. You are a Gem. Thanks.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top