I'm trying to copy the border format of range AV3: BE3 to the dynamic rows below. However, the code is copying the format till the 3,000th row and it's not stopping at the last row.
This is the code:
Dim my_range_AVtoBE As Range
Dim last_row As Long
'Define Dynamic Range Accoring to Column B
last_row = ActiveSheet.Cells(Rows.Count, 2).End(xlUp).Row
Set my_range_AVtoBE = ActiveSheet.Range("AV3:BE3" & last_row)
Range("AV3:BE3").Select
Selection.Copy
my_range_AVtoBE.PasteSpecial Paste:=xlPasteFormulasAndNumberFormats, Operation:=xlNone
my_range_AV.PasteSpecial xlPasteFormats
Application.CutCopyMode = False