I am trying to copy the format of one cell, highlight a range of cells and select visible cells only, and paste the format to those cells. The code is below. The last two lines is what is causing it to error. HELP
Selection.Copy
ActiveSheet.Range("$A$1:$LR$513").AutoFilter Field:=5, Criteria1:="PAB"
Range("F7").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.Copy
ActiveSheet.Range("$A$1:$LR$513").AutoFilter Field:=5, Criteria1:="PAB"
Range("F7").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False