Fill down to Last Row

MurraySMTH

Board Regular
Joined
Jun 30, 2020
Messages
81
Office Version
  1. 2016
Platform
  1. Windows
Hi I am trying to fill auto-fill down the A column to the last row with the word "canceled"

I have tried a few codes. This one just puts canceled in the A2 cell.

This report will vary with rows every time i run it, so i am trying to make sure it fills out canceled for the last row each time.

I am grateful for any advice.

Thank you.


Range("A2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "Canceled"
Range("A2").Select

Selection.AutoFill Destination:=Range("A2:A")

Range("A2:A").Select
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Do you mean down to the very last row on the worksheet, some 1,000,000+ of them? Probably not a good idea to load up your worksheet like that, but if that is what you are asking for...

Range("A2", Cells(Rows.Count, "A")).Value = "Canceled"
 
Upvote 0
Hi Rick!
No just the cells that are filled on the report. So if i pull my report for only 18 entries i want to make sure it populates the word canceled then fills down to the 18 cells on the report, i can't guarantee it will be 18 entries each time... so more of a lastrow type thing.

1594650010387.png
 
Upvote 0
Rick,
I used this formula also, it is giving me an error.

Dim LastRow As Long

LastRow = Range("A" & Rows.Count).End(xlUp).Row

Range("A2:A" & LastRow).Formula = "Canceled"
Range("A2").Select

ActiveCell.FormulaR1C1 = "Canceled"
Range("A2").Select

Selection.AutoFill Destination:=Range("A2:A")
 
Upvote 0
You need to delete this part of your code
VBA Code:
Range("A2").Select
  
   ActiveCell.FormulaR1C1 = "Canceled"
   Range("A2").Select
   
   Selection.AutoFill Destination:=Range("A2:A")
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,957
Latest member
Hat4Life

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