So I revised what I need now. What I need is to check if a particular cell has value, if it contains value, we go to Imagine tab 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 row (a:m) after filtering for the account and pasting it as values in sheet1
Sub Try()
Set rg = Sheets("Macro").Range("E39")
If rg.Value <> "" Then Sheets("Imagine").Range("A12:M12").AutoFilter Field:=2, Criteria1:=rg.Value
Selection.SpecialCells(xlCellTypeVisible).Select
'Copy the cells
Selection.Copy
Sheets(Sheet1).Range(a1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Cells.Select
Selection.Columns.AutoFit
End Sub
Bookmarks