+ Reply to Thread
Results 1 to 7 of 7

Need VBA code to find SAP Key from reference min to max sheet

  1. #1
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Need VBA code to find SAP Key from reference min to max sheet

    Dear experts

    i have master data with ref sheets like Ref_1,2,3,...etc

    i want find SAP KEY from ref's sheet start with min(Reference_2) range of (G2:H3), If concante column G:G match in range get result H:H, once done delete fist 3 row ,bring the next 2 row up. this action get change depends upon ref-sheet
    if its Ref_4 delete first 5 row bring up next 3
    if its Ref_3 delete first 4 row bring up next 3

    loop the action through all sheet once done msg box all sheet done

    there is one challenge, if combination order in 1,2 in report data sheet 2,1 need to find exact combination



    find the attachment
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Need VBA code to find SAP Key from reference min to max sheet

    Could you search for the SAP in column A? why would you need to find it in column G?

  3. #3
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Need VBA code to find SAP Key from reference min to max sheet

    Its SAP code In Column A but i want result SAP Key ID which is in column H:H

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Need VBA code to find SAP Key from reference min to max sheet

    Try this,
    For test purposes, the code places the results in Sheets("Reporting_Data_Output") column J So we can see that the results match your results.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Need VBA code to find SAP Key from reference min to max sheet

    hi sir works fine with your code, but if i reduce sheet getting error ,i run the code with Reference_2 only it getting error.

    find the attachment
    Attached Files Attached Files

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

    Re: Need VBA code to find SAP Key from reference min to max sheet

    Quote Originally Posted by johnmacpro View Post
    i want find SAP KEY from ref's sheet start with min(Reference_2) range of (G2:H3), If concante column G:G match in range get result H:H, once done delete fist 3 row ,bring the next 2 row up. this action get change depends upon ref-sheet
    if its Ref_4 delete first 5 row bring up next 3
    if its Ref_3 delete first 4 row bring up next 3

    there is one challenge, if combination order in 1,2 in report data sheet 2,1 need to find exact combination
    Fixed the code for the second red part.
    This extracts result in order of each sheet according to the first matched row.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jindon; 06-04-2023 at 10:21 PM.

  7. #7
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Need VBA code to find SAP Key from reference min to max sheet

    Thanks alot!! its works as i expected thanks for your valuable time and patient saved me & solved my problem

+ 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. [SOLVED] VBA Code to reference data on another sheet
    By Delta729 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-26-2017, 11:09 AM
  2. [SOLVED] Find and Replace using Sheet 2 as a Reference
    By Aquabat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-13-2014, 11:29 AM
  3. [SOLVED] Find duplicates in colA in one sheet and write them in another sheet with row reference
    By Masun in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-02-2013, 06:23 PM
  4. [SOLVED] Find out the reference number for a column for VBA code
    By Jiptastic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2012, 05:27 PM
  5. Replies: 3
    Last Post: 07-22-2011, 07:16 AM
  6. find <cell reference> copy to new sheet
    By ngocpdn in forum Excel General
    Replies: 1
    Last Post: 07-22-2011, 06:41 AM
  7. Change Sheet Reference w/o Find/Replace
    By Phillycheese5 in forum Excel General
    Replies: 1
    Last Post: 05-17-2007, 06:00 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