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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I'll try and have a look at the file when I get home, if someone hasn't come up with any new ideas.
 
Upvote 0
Thanks, appreciate it. Would be a nice surprise to wake up with a solution lol.

As a reminder the section for the code is on module 2 line 276. But sheet name2 will not appear until you hit run on the simple tab then hit run on the grouped tab.
 
Last edited:
Upvote 0
This code appears on line 496 to remove duplicates from column "O" in the name2 sheet.....would that be the problem !!
Did you also notice that the formula does in fact go to the last row in "A", but somewhere in your code you are deleting the formula for about 2500 rows !
Code:
'remove duplicates from name2
    With Sheets("name2").Range("O1:O" & Cells(Rows.Count, "O").End(xlUp).Row)
    .RemoveDuplicates Columns:=1, Header:=xlNo
    End With
 
Upvote 0
More info...
The code snippet in the previous post is definitely the problem !!
The formulas are all there until it gets to those line of code and they delete the entries in Col "O", which I'm guessing are duplicates !
 
Upvote 0
Thank You! Really appreciate the help solving this problem. So the problem was actually with the remove duplicate code. I changed the code to
Code:
   Sheets("name2").Select
    Cells.RemoveDuplicates Columns:=15, Header:=xlNo


Even though I'm not sure why the previous code did not work but oh well.
 
Upvote 0

Forum statistics

Threads
1,216,169
Messages
6,129,272
Members
449,497
Latest member
The Wamp

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