+ Reply to Thread
Results 1 to 7 of 7

VBA, Intercept 2 giving range from 2 sheet,If condition, intercepted copy to 3rd sheet

  1. #1
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    VBA, Intercept 2 giving range from 2 sheet,If condition, intercepted copy to 3rd sheet

    Hi all, !!

    I been searching the net about intercept ranges and copy to another sheet, but i can't find something "easier" for my knowledge and modify it...., please i need some help, i'm still learning VBA (God, i think my iq is getting away lol.. )

    okay, this is the trouble :
    -----------------------
    sheet and Column to be compare :
    SHEET-1 -> Column A,C,E <--versus--> PAGE-2 -> Column A,C,E,G,I

    Sheet to copy compared data w/ condition :
    sheet -> "INTERCEPTED"


    Example :
    ---------
    Compare Range A3:A20 Worksheet "SHEET1"
    against Range A3:A20 worksheet "PAGE-2"
    Condition:
    If Min/Max Numbers (5 to 12 numbers ) are Intercepted,
    Then paste these intercepted numbers in Empty cell Range A3 (down) of worksheet "intercepted" .
    --------------------------------------------
    Then the same Range A3:A20 worksheet "SHEET1"
    against Range C3:C20 worksheet "PAGE-2"
    Again the Condition :
    If Min/Max Condition Meet, (5 to 12 numbers Intercepted ) ,
    Then paste these intercepted numbers in empty cell Range B3 (down) of worksheet "intercepted" .
    --------------------------------------------
    Then the same Range A3:A20 worksheet "SHEET1"
    against Range E3:E20 worksheet "PAGE-2"
    If Min/Max Condition Meet, Then paste intercepted empty cell of Range C3 (down) of worksheet "intercepted" .
    ---------------------------------------------
    Then the same till reach interception Range A3:A20 (SHEET1) to I3:I20 of worksheet "PAGE-2"
    ---------------------------------------------
    Then Start over with Range
    Compare Range C3:C20 Worksheet "SHEET1"
    against Range A3:A20 worksheet "PAGE-2"
    If Condition Meet, Then paste intercepted empty cell of Range C3 (down) of worksheet "intercepted" .

    till reach interception Range E3:E20 (SHEET1) to I3:I20 of worksheet "PAGE-2 "


    NOTE:
    what i need to do is 10 times bigger,(than the sheet sample) i'm pretty sure that if i see a code structure (if someone help me)
    i achieve the whole thing (modifying or expanding the code, U know... part of my learning..)


    Best Regards

    David
    Last edited by david gonzalez; 08-20-2014 at 08:35 PM. Reason: deleting extra paragraph,change font

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: VBA, Intercept 2 giving range from 2 sheet,If condition, intercepted copy to 3rd sheet

    Hi,
    Can you explain a little more how you compare the range from Sheet1 with the one in Page-2.
    Is it cell by cell? example A3 vs A3

    What do you mean by "If Min/Max Numbers (5 to 12 numbers ) are Intercepted"
    Would help if you could provide expected output in your sample workbook for at least the first comparison (A-A).
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: VBA, Intercept 2 giving range from 2 sheet,If condition, intercepted copy to 3rd sheet

    Hi Mr GC Excel,

    no cell by cell, is by range :
    range A3:A20 (Sheet-1) Compare against range A3:A20 (Page-2)

    from the sheet sample :
    SHEET-1 Column A3:A20 <-VS-> PAGE-2 Column A3:A20

    Both ranges have 20 numbers, but after compare, none of these numbers match

    so the condition is not meet.

    But (hypothetically) , if more than 5 numbers exist in both ranges, ( for example 20,31,02,12,07,15 )
    then numbers intercepted have to go in Column A of Sheet named "INTERCEPTED"
    20
    31
    02
    12
    07
    15
    (in next empty cell )

    Thank you

    Best Regards

    David

  4. #4
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: VBA, Intercept 2 giving range from 2 sheet,If condition, intercepted copy to 3rd sheet

    Quote Originally Posted by GC Excel View Post
    Hi,
    What do you mean by "If Min/Max Numbers (5 to 12 numbers ) are Intercepted"
    Would help if you could provide expected output in your sample workbook for at least the first comparison (A-A).

    The Min/Max is the condition of for example :
    If in Sheet "SHEET-1" and in PAGE-2" are intercepted less than 5 numbers or More than 12 Numbers,
    then not copy in sheet named "INTERCEPTED"

    When i say numbers Intercepted, i mean that numbers exist in both ranges of both sheet.


    Best Regards

    David
    Last edited by david gonzalez; 08-20-2014 at 09:12 PM. Reason: correction

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: VBA, Intercept 2 giving range from 2 sheet,If condition, intercepted copy to 3rd sheet

    Quote Originally Posted by david gonzalez View Post
    from the sheet sample :
    SHEET-1 Column A3:A20 <-VS-> PAGE-2 Column A3:A20

    Both ranges have 20 numbers, but after compare, none of these numbers match

    so the condition is not meet.
    20 numbers?

  6. #6
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: VBA, Intercept 2 giving range from 2 sheet,If condition, intercepted copy to 3rd sheet

    Hi Mr Jindon , !!

    Yes sir is Duplicated (sorry, .. )

    and is 18 numbers starting Row 3 till row 20..


    Best Regards

    David

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: VBA, Intercept 2 giving range from 2 sheet,If condition, intercepted copy to 3rd sheet

    See if my understanding is correct,
    Please Login or Register  to view this content.
    Last edited by jindon; 08-20-2014 at 09:36 PM. Reason: Just found a typo.... fixed

+ 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. Replies: 1
    Last Post: 09-17-2013, 01:38 PM
  2. [SOLVED] Copy rows from active sheet to another sheet (last row) if condition in column X is met
    By mortless in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-17-2013, 08:11 AM
  3. [SOLVED] Copy Data Range to another sheet based on a condition.
    By psunursingguy21 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-30-2013, 03:50 PM
  4. select a column range based on a condition and copy to another sheet
    By GSCCK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-02-2012, 10:59 PM
  5. Copy specific range from sheet to another if condition in cell met
    By Zagadka in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-28-2012, 11:42 AM

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