Hey,
How do I go about changing the following code so that the data copied over is copied starting from a specific cell and not just the first unused row in the sheet. Any help would be appreciated. I have attached the example workbook, but say I wanted to data to copy into the Template Data sheet but only starting from A20 on the sheet, how do I do that.
Thanks in advance.
Code
Option Explicit
Sub Filter_Copy_Paste()
Dim lr1 As Long
Dim lr2 As Long
With Sheets("Market Data")
lr1 = .Cells(Rows.Count, 1).End(xlUp).Row 'last used row in sheet Market Data
.AutoFilterMode = False
.Range("A3:Y" & lr1).AutoFilter Field:=3, Criteria1:="ALBANIA" 'filter range on ALBANIA
lr2 = Sheets("Template Data").Cells(Rows.Count, 1).End(xlUp).Row + 1 'first unused row in sheet Template Data
.Range("E4:Y" & lr1).SpecialCells(xlCellTypeVisible).Copy Sheets("Template Data").Range("A" & lr2) 'Copy/Paste
.AutoFilterMode = False
End With
Application.CutCopyMode = False
End Sub
Display More