+ Reply to Thread
Results 1 to 6 of 6

copy full row to another sheet if conditions are satisfied

  1. #1
    Forum Contributor
    Join Date
    10-30-2019
    Location
    GUJARAT,INDIA
    MS-Off Ver
    MS OFFICE 2016
    Posts
    134

    copy full row to another sheet if conditions are satisfied

    I request experts of this forum to help me in creating code to copy full row to another sheet if conditions are satisfied


    copy full row from Sheet1 to Sheet2 if conditions are met.

    CONDITIONS:-

    1 Col. "FROM" of Sheet1 is >= col. T4 of sheet 2
    AND
    2 Col. "TO" of Sheet1 is <= col. T5 of sheet 2
    AND
    3 Col. "ITEM CODE" of Sheet1 is =col. R9 0r S9 or T9 0r U9 0r V9 of sheet 2

    Expected result in Sheet-2

    Hope somebody will help me.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this !


    According to your attachment a VBA demonstration for starters to paste to the Sheet2 worksheet module :

    PHP Code: 
    Sub Demo1()
        
    With Sheet1
            
    .[Q2].Formula Replace("=AND(F2>='#'!$T$4,G2<='#'!$T$5,ISNUMBER(MATCH(J2,'#'!$R$9:$V$9,0)))""#"Name)
            .[
    A1].CurrentRegion.AdvancedFilter 2, .[Q1:Q2], [C1:Q1]
            .[
    Q2].Clear
        End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  3. #3
    Forum Contributor
    Join Date
    10-30-2019
    Location
    GUJARAT,INDIA
    MS-Off Ver
    MS OFFICE 2016
    Posts
    134

    Re: copy full row to another sheet if conditions are satisfied

    Code is not working "runtime error 1004" Application-defined or object-defined error"(refer attachments)
    debug error at .[Q2].Formula = Replace("=AND(F2>='#'!$T$4,G2<='#'!$T$5,ISNUMBER(MATCH(J2,'#'!$R$9:$V$9,0)))", "#", Name)
    Kindly provide solution.
    Attached Images Attached Images

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,612

    Re: copy full row to another sheet if conditions are satisfied

    Formula will do.
    In C2 of Sheet2 then copied across and down.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: copy full row to another sheet if conditions are satisfied


    Quote Originally Posted by kv.singh View Post
    Code is not working "runtime error 1004" Application-defined or object-defined error"(refer attachments)
    As it works a treat on my side so according to your pictures you felt in the bad readers trap !
    Just well read and apply the dark red direction in post #2 …

  6. #6
    Forum Contributor
    Join Date
    10-30-2019
    Location
    GUJARAT,INDIA
    MS-Off Ver
    MS OFFICE 2016
    Posts
    134

    Re: copy full row to another sheet if conditions are satisfied

    Thanks Murthy your code is giving desired result.
    @Marc L sorry for inconvenience but I still not understand what you want to explain.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Extract Values If Conditions are Satisfied
    By bjnockle in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-13-2021, 10:05 AM
  2. [SOLVED] Return an answer if 4 conditions are satisfied
    By allen003 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-03-2020, 11:14 AM
  3. Track the number of SATISFIED Conditions as Individual or Overlapped...
    By e4excel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-14-2017, 01:20 AM
  4. [SOLVED] compute an average if certain conditions are satisfied
    By anita2017 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-07-2017, 10:29 AM
  5. Replies: 5
    Last Post: 08-18-2016, 09:13 AM
  6. Linked Lookup IF 2 conditions are satisfied
    By reghu in forum Excel General
    Replies: 0
    Last Post: 09-01-2010, 07:13 AM
  7. Replies: 10
    Last Post: 08-28-2008, 06:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1