What I need is to check if a particular cell has value, if it contains value, we go to Imagine sheet and filter B12 for the account or value of cell e39 of macro. A12:m12(headers). everything works well from there now i need to copy the rows (a:m) after filtering for the account and pasting it as values in sheet1
<code style="margin: 0px; padding: 0px; font-style: inherit;">Sub Try()Set rg = Sheets("Macro").Range("E39")If rg.Value <> "" Then Sheets("Imagine").Range("A12:M12").AutoFilter Field:=2, Criteria1:=rg.ValueSelection.SpecialCells(xlCellTypeVisible).Select'Copy the cellsSelection.CopySheets(Sheet1).Range(a1).SelectSelection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = FalseCells.SelectSelection.Columns.AutoFitEnd Sub</code></pre>

<code style="margin: 0px; padding: 0px; font-style: inherit;">Sub Try()Set rg = Sheets("Macro").Range("E39")If rg.Value <> "" Then Sheets("Imagine").Range("A12:M12").AutoFilter Field:=2, Criteria1:=rg.ValueSelection.SpecialCells(xlCellTypeVisible).Select'Copy the cellsSelection.CopySheets(Sheet1).Range(a1).SelectSelection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = FalseCells.SelectSelection.Columns.AutoFitEnd Sub</code></pre>