Fill down to Last Row

MurraySMTH

Board Regular
Joined
Jun 30, 2020
Messages
76
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
 

Some videos you may like

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,892
Office Version
  1. 2010
Platform
  1. Windows
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"
 

MurraySMTH

Board Regular
Joined
Jun 30, 2020
Messages
76
Office Version
  1. 2016
Platform
  1. Windows
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
 

MurraySMTH

Board Regular
Joined
Jun 30, 2020
Messages
76
Office Version
  1. 2016
Platform
  1. Windows
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")
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,771
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

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")
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,771
Office Version
  1. 365
Platform
  1. Windows
Glad we could help & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,128,086
Messages
5,628,591
Members
416,326
Latest member
NinaChristal

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
Top