Autofill formula not working

wonderd

Board Regular
Joined
Oct 20, 2013
Messages
168
Hello I am using the below auto fill code but for some reason it is not filling the formula to the last cell.
Code:
Sheets("name2").Select        
Range("O1").Select
    ActiveCell.FormulaR1C1 = _
        "=RC[-14]&RC[-13]&RC[-12]&RC[-11]&RC[-10]&RC[-9]&RC[-8]&RC[-7]&RC[-6]&RC[-5]&RC[-4]&RC[-3]&RC[-2]&RC[-1]"
    Range("O1").Select
    Selection.AutoFill Destination:=Range("O1:O" & Range("A" & Rows.Count).End(xlUp).Row)

The code is suppose to auto fill the formula in column O down to the last cell of the sheet in accordance to the last cell in column A.

Column A has data but the formula doesn't want to go down.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
You code works fine for me, but this may be a bit quicker...and may work
Code:
Sub test()
Sheets("name2").Range("O1:O" & Range("A" & Rows.Count).End(xlUp).Row).FormulaR1C1 = _
        "=RC[-14]&RC[-13]&RC[-12]&RC[-11]&RC[-10]&RC[-9]&RC[-8]&RC[-7]&RC[-6]&RC[-5]&RC[-4]&RC[-3]&RC[-2]&RC[-1]"
End Sub
 
Upvote 0
I have tried your code and for some reason it still does not copy all the way down. It stops mid way like my original formula. There are also no gaps in the data .
 
Upvote 0
What is in Col "A" where the data doesn't fill...Actual data OR blanks with formulas in them.
If there are formulas returning blank values they won't be counted
 
Upvote 0
Its actual data. This formula is ran within a macro but that shouldn't make a difference I dont think.
 
Upvote 0
This formula is ran within a macro but that shouldn't make a difference I dont think.
Can you post the macro.
As mentioned there is no reason, if there is data in col "A" for it not to fill
The code isn't in a sheet module is it ??
 
Upvote 0
Yes the code is in a sheet module. Does that make a difference?

The macro can be downloaded at this link www.varietyrugs.com/macro.xlsm its to big to upload here.

To see the problem click on user interface simple tab and hit run then after it completes select grouped tab then hit run. Once finished you will see the name2 sheet with the problem.
 
Upvote 0
No, sorry....I don't download !
I would have thought the code would need to be in a Standard module OR This Workbook.
IS the sheet module a worksheet Change event or similar ?

Maybe someone else is willing to download the workbook !
 
Upvote 0
I don't know how to answer your question. I request help often on this forum and would never put anyone's computer in danger with a file. However I understand your position.

Also the code for this is on macro 2 sheet line 276.
 
Last edited:
Upvote 0
Yeah, sorry...it's a work thing, nothing personal...
just a thought ....does Col "A" get populated before the formula code is run ?
 
Upvote 0

Forum statistics

Threads
1,214,659
Messages
6,120,786
Members
448,994
Latest member
rohitsomani

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