+ Reply to Thread
Results 1 to 10 of 10

Codes for same column with index and match function looping

  1. #1
    Registered User
    Join Date
    03-10-2015
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    85

    Lightbulb Codes for same column with index and match function looping

    Please help me coding index and match in same columng.

    sample

    i have this in column C and D
    1 A
    2 B
    3 C
    4 D
    5 E

    and i want to have a macro code whichever i write something in column A result will be across

    result
    Column A

    1 = A
    3 = C

    Thanks
    Last edited by ash3angel; 03-24-2015 at 12:43 AM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Codes for same column with index and match function looping

    Copy the below code and do right click on sheet tab and select view code and paste it.

    Close the VBA window (Alt+Q to close VBA window) and return to that sheet and check.

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    03-10-2015
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    85

    Re: Codes for same column with index and match function looping

    Great codes, i really can't understand your codes

    <>Sub code()

    Dim i As Integer

    For i = 1 To 5

    If Cells(i, 1) = Cells(i, 6) Then
    Cells(i, 1) = Cells(i, 7)

    End If
    Next

    End Sub<>

  4. #4
    Registered User
    Join Date
    03-10-2015
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    85

    Re: Codes for same column with index and match function looping

    Its perfect now, i just remove the offset formula. thanks

    i don't understand what does target do and variant and using the application as formula

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Codes for same column with index and match function looping

    Quote Originally Posted by ash3angel View Post
    i don't understand what does target do and variant and using the application as formula
    I used Worksheet Change Event.

    The Target Refers to the Cell on which the Change Occurs.

    Match() will result a number (if match found) or an error (if match is not found) so used a variant to hold both number and error value.

    Used IsNumeric() to check whether its resulted a number if number then it will proceed further

  6. #6
    Registered User
    Join Date
    03-10-2015
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    85

    Re: Codes for same column with index and match function looping

    so many jargon word, i have not encountered the worksheet change event, i am self taught so i move slower learning all this. i am learning by coding what i think and if i can't answer it i ask help here. very thanks to this site and to you sharing your knowledge.

    if im going to add new criteria i will add a word which says ***nothing as follows*** in the end of my first look up how can i do that?

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Codes for same column with index and match function looping

    Read the below links to know about events

    http://www.ozgrid.com/VBA/run-macros-change.htm

    http://www.excel-easy.com/vba/events.html

    Quote Originally Posted by ash3angel View Post
    if im going to add new criteria i will add a word which says ***nothing as follows*** in the end of my first look up how can i do that?
    Please make the above sentence more descriptive

  8. #8
    Registered User
    Join Date
    03-10-2015
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    85

    Re: Codes for same column with index and match function looping

    i mean i want to add ***nothing as follows*** in the end of my statement.

    Column A

    result will be

    A
    B
    C
    ***nothing as follows***

    thanks for the reference

  9. #9
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Codes for same column with index and match function looping

    Replace the previous code with the below one

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    03-10-2015
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    85

    Re: Codes for same column with index and match function looping

    Great, Thanks so much. i will practice the code you gave me.

+ 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: 6
    Last Post: 11-08-2013, 10:29 PM
  2. Column comparison using match and index function
    By shraddha5 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-17-2013, 01:11 AM
  3. Looping Index and Match Function in VBA
    By Tleong in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-15-2012, 11:50 PM
  4. Return Column Header from Index/Match function
    By del24ie in forum Excel General
    Replies: 2
    Last Post: 01-12-2012, 11:57 AM
  5. Index/Match Function to Return column header
    By djmarsh51 in forum Excel General
    Replies: 2
    Last Post: 05-07-2010, 02:10 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