AutoFill method of Range Class Failed

s_simon

New Member
Joined
Sep 12, 2018
Messages
10
I have formulas in ever cell from J3 thru BH3

Code:
Worksheets("Master_Week").Range("J3").Select
Selection.AutoFill Destination:=Range("J3:BH2560"), Type:=xlFillDefault
However the above code fails. Any ideas? Thanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
If you aren't already on the sheet, it won't work.
Try this:
Code:
Sheets("Master_Week").Activate
Range("J3").AutoFill Destination:=Range("J3:BH2560"), Type:=xlFillDefault
 
Upvote 0
If you aren't already on the sheet, it won't work.
Try this:
Code:
Sheets("Master_Week").Activate
Range("J3").AutoFill Destination:=Range("J3:BH2560"), Type:=xlFillDefault

Still the same issue
Code:
Sheets("Master_Week").Activate
Range("J3").AutoFill Destination:=Range(newCol), Type:=xlFillDefault

I have a watch on newCol and can confirm that it is equal to : J3:BH2237
I have tried: Worksheets("Master_Week").Active = Failed
also Worksheets("Master_Week").Range("J3")... = Failed
 
Upvote 0
What about
Code:
With Sheets("Master_Week")
   .Range("J3:BH3").AutoFill Destination:=.Range("J3:BH2560"), Type:=xlFillDefault
End With
 
Upvote 0
What about
Code:
With Sheets("Master_Week")
   .Range("J3:BH3").AutoFill Destination:=.Range("J3:BH2560"), Type:=xlFillDefault
End With

That's it!!

I knew that I needed the range first - not sure why I was thinking I only needed the first cell of the range
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0
Odd. The first reply I posted seemed to work on my home computer (using Excel 2016), but not on my work one here (using Excel 2010).
 
Upvote 0
Sounds like MS have changed something, as it doesn't work in 2013 either.
 
Upvote 0
Sounds like MS have changed something, as it doesn't work in 2013 either.
It worked...
I didn't look closely to see if it did the right thing (and not copy the formula from J3 to all the other cells), but it populated the cells and didn't error out.
I am curious to actually check closer and see if it copied the formulas correctly. Maybe I will check again when at home.
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,727
Members
449,049
Latest member
MiguekHeka

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