Satya12778
New Member
Hi All,
I am having 2 excel sheets one is source another one is macro, my problem is
in the source file we will do filtering for 2 columns after that in the visible cells we need to check one condition in that "E" col text is found or not.
if text found copy columns for that particular row not all columns and paste it into another sheet.
if text not found take the another row value and paste it into another sheet
this is the sample image A and B are filtered columns after filter we get the result like this , after we have to check "E" col if "<100" found copy the D columns of that particular row and paste it into another .
not found take the another visible cell copy d col value.
i tried one code but it is taking all visible values for particular columns
this code which i used
please help me about this
I am having 2 excel sheets one is source another one is macro, my problem is
in the source file we will do filtering for 2 columns after that in the visible cells we need to check one condition in that "E" col text is found or not.
if text found copy columns for that particular row not all columns and paste it into another sheet.
if text not found take the another row value and paste it into another sheet
this is the sample image A and B are filtered columns after filter we get the result like this , after we have to check "E" col if "<100" found copy the D columns of that particular row and paste it into another .
not found take the another visible cell copy d col value.
i tried one code but it is taking all visible values for particular columns
this code which i used
Code:
If InStr(Range("E" & i).Value, "<100") > 0 Then
ActiveSheet.Range("D:D").SpecialCells(xlCellTypeVisible).Copy
Windows("Output file.xlsm").Activate
Worksheets("Macro").Activate
ActiveSheet.Range("E" & i).PasteSpecial Paste:=xlPasteValues
Else
ActiveSheet.Range("F:F").SpecialCells(xlCellTypeVisible).Copy
Windows("Output file.xlsm").Activate
Worksheets("Macro").Activate
ActiveSheet.Range("C:C").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
please help me about this
Attachments
Last edited: