• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Copy row value if condition is met in that particular row

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
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

  • Capture.PNG
    Capture.PNG
    12.5 KB · Views: 2
Last edited:
Hi,​
as this is a wild cross posting so first read this !
Then as a reminder :​

Then you should edit your post in order to be at the level of what any Excel forum expects for :​
  • add your entire code
  • add a link for each other Excel forum where you have created the same thread
  • add a workbook attachment …
 
Back
Top