VBA code for autofill until empty

Status
Not open for further replies.

DRG1978

New Member
Joined
Jan 20, 2017
Messages
37
Hi All,

Can you please help me by adjusting this VBA for autofill until empty for the following ranges?


  • ActiveSheet.Range("$B$1:$N$115326")
  • Selection.AutoFill Destination:=Range("A2:A115324")


Thank you very much!!!

P.S.

See VBA.
-----------------------------------------------------------------------------------------------

Sub Item_Stock()
'
' Item_Stock Macro
'
' Keyboard Shortcut: Ctrl+y
'
Application.CutCopyMode = False
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Rows("1:2").Select
Selection.Delete Shift:=xlUp
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("B1").Select
Selection.Copy
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "Date"
Columns("B:N").Select
Selection.AutoFilter
ActiveSheet.Range("$B$1:$N$115326").AutoFilter Field:=3, Criteria1:="=NO", _
Operator:=xlOr, Criteria2:="="
ActiveSheet.Range("$B$1:$N$115326").AutoFilter Field:=5, Criteria1:="AMS"
Range("B1").Select
Selection.AutoFilter
Range("A2").Select
ActiveCell.FormulaR1C1 = "5/23/2018"
Range("A2").Select
Selection.NumberFormat = "[$-en-US]d-mmm-yy;@"
Selection.AutoFill Destination:=Range("A2:A115324")
Range("A2:A115324").Select
Selection.AutoFill Destination:=Range("A2:A115324"), Type:=xlFillCopy
Range("A2:A115324").Select
Columns("A:N").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$N$115326").AutoFilter Field:=4, Criteria1:="=NO", _
Operator:=xlOr, Criteria2:="="
ActiveSheet.Range("$A$1:$N$115326").AutoFilter Field:=6, Criteria1:="AMS"
Range("B1").Select
ActiveWindow.SmallScroll Down:=-3
End Sub
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Status
Not open for further replies.

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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