+ Reply to Thread
Results 1 to 10 of 10

copy cell in row to another sheet if criteria is met

  1. #1
    Registered User
    Join Date
    03-05-2015
    Location
    New Jersey
    MS-Off Ver
    2007
    Posts
    9

    copy cell in row to another sheet if criteria is met

    Hi,
    I am a novice so please bear with me.

    I am looking at row 2 in sheet 1. I would like to copy any cell in this row if the cell in the same column @ row 44 is > 1 to another sheet (sheet2 beginning at c17 and down if empty.

    I am stuck on the if/then. How do I globally look for criteria in each column without separately listing an if/then for each.



    THIS IS WHAT I HAVE SO FAR....

    Please Login or Register  to view this content.
    Any assistance would be appreciated
    thebrin
    Last edited by thebrin; 03-05-2015 at 01:45 PM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,891

    Re: copy cell in row to another sheet if criteria is met

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    Best Regards,

    Kaper

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: copy cell in row to another sheet if criteria is met

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,891

    Re: copy cell in row to another sheet if criteria is met

    You may also try something like:
    Please Login or Register  to view this content.
    and note how is ot easy to read the above in code tags - so please edit your post.

  5. #5
    Registered User
    Join Date
    03-05-2015
    Location
    New Jersey
    MS-Off Ver
    2007
    Posts
    9

    Re: copy cell in row to another sheet if criteria is met

    Quote Originally Posted by Kaper View Post
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    Sorry - will read forum rules

  6. #6
    Registered User
    Join Date
    03-05-2015
    Location
    New Jersey
    MS-Off Ver
    2007
    Posts
    9

    Re: copy cell in row to another sheet if criteria is met

    Thanks stnkynts - I ran the code and it does indeed place the first result into C17 , but there are multiple columns that meet the criteria and it only placed the 1st result it found, not the rest. Your thoughts?

  7. #7
    Registered User
    Join Date
    03-05-2015
    Location
    New Jersey
    MS-Off Ver
    2007
    Posts
    9

    Re: copy cell in row to another sheet if criteria is met

    Thanks Kaper - I ran the code and I am getting a syntax error on line
    Please Login or Register  to view this content.

  8. #8
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,891

    Re: copy cell in row to another sheet if criteria is met

    Please Login or Register  to view this content.
    anyway - not tested it because there is no sample file (and I'm too lazy/busy to create one :-P)
    as for the code by stnkynts - at first sight - shall list all values where criterium (row 44 value in resp. column >1) is met

  9. #9
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,891

    Re: copy cell in row to another sheet if criteria is met

    By the way in my code here shall be 42 as offset I thing - current row is 2 so offsetted down by 42 will be 44 :mrgreen:
    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: copy cell in row to another sheet if criteria is met

    Thanks stnkynts - I ran the code and it does indeed place the first result into C17 , but there are multiple columns that meet the criteria and it only placed the 1st result it found, not the rest. Your thoughts?
    Worked just fine for me when tested. Submit an example workbook

+ 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. Copy text from one sheet to another if one cell meets criteria
    By dptiedtke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-11-2014, 06:20 AM
  2. Get Value from Cell if Criteria is accomplished then Copy to another Sheet
    By jjislas in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-21-2013, 11:22 AM
  3. Replies: 0
    Last Post: 11-21-2007, 07:39 AM
  4. Replies: 1
    Last Post: 11-20-2007, 06:19 PM

Tags for this Thread

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