Runtime 1004: Range class method failed

Creed2709

New Member
Joined
May 4, 2018
Messages
1
Hi MrExcel Forum,

First time poster (to any forums), was wondering if anyone can help me with this tiny bit of code on here. I see similar issues posted to the forums but nobody says what the underlying cause is so I'm not sure how to fix my particular situation.

What I want it to do:

Go to cell below the end of my table
Find the last non blank cell which contains a formula
autofill this formula to the bottom of the table for Col (F:J & O:Q)

This is what I have but I get the 1004 runtime error which I can't see whats causing it or why? I would repeat this formula for each column I would intend.

HTML:
endline = detailsht.range("f10000").end(xlup).row
currentlines = detailsht.range("f10000").end(xlup).end(xlup).row

detailsht.range("f100000").end(xlup).end(xlup).select                                              ''''''''this is the problem line.
selection.autofill destination:=detailsht.range("f" & currentlines & ":" & "f" & endline)



Any help would be much appreciated as I am new to VBA but keen to learn.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
You can only use select on the active, so I suspect that your "detailsht" is not the active sheet.
 
Upvote 0

Forum statistics

Threads
1,223,157
Messages
6,170,418
Members
452,325
Latest member
BlahQz

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