Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,075
- Office Version
- 2019
- Platform
- Windows
Code:
Dim rData As RangeDim Lst As Long, LRow As Long
LRow = Range("W" & Rows.Count).End(xlUp).Row
Range("V18:Y" & LRow).ClearContents
Set rData = Range("A18", Range("B" & Rows.Count).End(xlUp))
rData.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("W18"), Unique:=True
With Range("W18").CurrentRegion
.Sort Key1:=.Columns(1), Order1:=xlAscending, Header:=xlYes
.Columns(3).Formula = "=SUMIF(" & rData.Columns(1).Address & ",W18," & rData.Columns(16).Address & ")"
Range("V18") = 1
Range("V18").AutoFill Destination:=Range("V18").Resize(LRow), Type:=xlFillSeries
End With
I'm trying to autofill numerical numbers to the last used row in column W, but the autofill fills in an additional 16 numbers past the last row in column W. Please help fix my dilemma
Also I set my table to start from Row 18 and I adjusted this part of the code, but I'm not sure I understand why I can't adjust Range("B" & Rows.Count to reflect it to start from row 18
Code:
Set rData = Range("A18", Range("B" & Rows.Count).End(xlUp))
Thank you kindly
Last edited: