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

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
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,214,830
Messages
6,121,835
Members
449,051
Latest member
excelquestion515

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