+ Reply to Thread
Results 1 to 6 of 6

VBA to do a Index and Match function

  1. #1
    Forum Contributor
    Join Date
    02-23-2014
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    174

    VBA to do a Index and Match function

    Hi Experts
    I need some help with VBA.

    I need a VBA to perform an Index and Match and populate some columns in the table
    • When a job number is entered in the Production Order column "G" need a VBA to do an Index and Match function and pupulate the Item Code; Description & Quantity columns by looking up in the Database Table


    The Database table grows by 40 rows a day, so in a month it could grow by 800 rows. Would a VBA running Index and Match be the best and fast solution?

    I have attached a sample file

    Thanks
    Regards
    Rahul
    Attached Files Attached Files
    Last edited by rahul_ferns76; 07-18-2018 at 09:31 PM.

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

    Cool Hi ! Try this ‼


    According to your thread title this is the worksheet event for the Index / Match part
    but using instead the search Excel inner feature as a starter, to paste to the worksheet TAG Data module :

    PHP Code: 
    Private Sub Worksheet_Change(ByVal Target As Range)
          Const 
    "Database"
            
    Dim Rg As Range
        
    If Not Intersect(Me.ListObjects("TAG_Data").DataBodyRange.Columns(6), Target(1)) Is Nothing Then
            Set Rg 
    Worksheets(D).ListObjects(D).DataBodyRange.Columns(1).Find(Target(1).Value, , xlValuesxlWhole)
            
    Application.EnableEvents False
          With Target
    (12).Resize(, 3)
             If 
    Rg Is Nothing Then
                
    .ClearContents
             
    Else
                .
    Value Rg(12).Resize(, 3).Value
                 Set Rg 
    Nothing
             End 
    If
          
    End With
            Application
    .EnableEvents True
        End 
    If
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !
    Last edited by Marc L; 07-17-2018 at 05:49 AM. Reason: optimization …

  3. #3
    Forum Contributor
    Join Date
    02-23-2014
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    174

    Re: Hi ! Try this ‼

    Hi Marc
    Works like a charm

    Would you be able to help me with a vba for the button on my work sheet?

    Thanks

    Regards
    Rahul

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

    Re: VBA to do a Index and Match function

    Quote Originally Posted by rahul_ferns76 View Post
    5.Tag No & Date column gets locked so cant be edited
    You must first unlock all editable cells then protect the worksheet with a password or without …

    As you mixed two differents needs in this thread and as the first need does not match with the thread title,
    if nobody helps until tomorrow you can create a new thread for your first query …

  5. #5
    Forum Contributor
    Join Date
    02-23-2014
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    174

    Re: VBA to do a Index and Match function

    Hi Marc
    I have modified my original request and deleted the VBA requirement for the button
    One question per thread as you suggested

    I will post another thread for my other question

    I had to remove the TAG_Data table so need the VBA modified

    Will ask the question again as a separate thread, could you help me with that?

    Regards
    Rahul
    Last edited by rahul_ferns76; 07-18-2018 at 09:39 PM.

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

    Re: VBA to do a Index and Match function


    Yes maybe as I'm not alone here to help …

+ 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] Large Data - Index Match Match with another function?
    By d7882 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 10-12-2017, 03:51 PM
  2. Need help in Index, Match usage to match multiple criteria in sum function
    By Summer0830 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-26-2017, 02:47 AM
  3. Problems applying INDEX-MATCH-MATCH function on other data
    By LennartB in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-13-2015, 05:33 AM
  4. function INDEX MATCH MATCH doesn´t work
    By leonelcd in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-31-2015, 11:36 AM
  5. [SOLVED] Stuck on Match function with #N/A; attempting to reverse Index/Match
    By Cappytano in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-10-2014, 06:39 PM
  6. Replies: 6
    Last Post: 03-17-2014, 08:10 PM
  7. Replies: 3
    Last Post: 06-17-2013, 12:37 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