+ Reply to Thread
Results 1 to 8 of 8

Calling data from another sheet with an if function or macro

  1. #1
    Registered User
    Join Date
    09-25-2013
    Location
    myob,ok
    MS-Off Ver
    Excel 2007
    Posts
    63

    Calling data from another sheet with an if function or macro

    Hello everyone,

    I've never attempted to this before but in my workbook I have 2 active worksheets I use. In Sheet1 I have a name in one column and a value in another column. What I would like to be able to do in sheet2 is whenever I enter a value that matches what is in sheet 1, I want the name in that row to be automatically inserted next to my value in sheet 2.

    Thank you for your time!

  2. #2
    Registered User
    Join Date
    04-29-2013
    Location
    Ontario, Canada
    MS-Off Ver
    MS Office 2010
    Posts
    80

    Re: Calling data from another sheet with an if function or macro

    Hi superboy,

    It seems like what you need is the VLOOKUP function. Here is a spreadsheet showing you how.

    Hope this helps.
    Attached Files Attached Files
    Last edited by Draconi; 11-02-2013 at 08:11 AM. Reason: Resubmit with new data
    Draconi

  3. #3
    Registered User
    Join Date
    09-25-2013
    Location
    myob,ok
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Calling data from another sheet with an if function or macro

    It works, but what if my value entered in the second sheet is part of a bigger text I pasted in that cell. How can I get VLOOKUP to still bring up the corresponding data.

  4. #4
    Registered User
    Join Date
    04-29-2013
    Location
    Ontario, Canada
    MS-Off Ver
    MS Office 2010
    Posts
    80

    Re: Calling data from another sheet with an if function or macro

    This might help:

    Example: If the value is "101_Test_55_12"

    LEFT: This will look for "101"
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    RIGHT: This will look for "12"
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    MID: This will look for "55"
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-25-2013
    Location
    myob,ok
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Calling data from another sheet with an if function or macro

    I'm sorry I should have been more specific. Below is what I usually paste in my cell

    123-1234567-1234567
    HDTelevision
    QTY: 1 ASIN: B0045678 SKU: AI-V1AA-BCDE9

    I VLookUp to look at the value after SKU, specifically "A1-V1AA-BCDE9

  6. #6
    Registered User
    Join Date
    04-29-2013
    Location
    Ontario, Canada
    MS-Off Ver
    MS Office 2010
    Posts
    80

    Re: Calling data from another sheet with an if function or macro

    This formula should extract "A1-V1AA-BCDE9" from "QTY: 1 ASIN: B0045678 SKU: AI-V1AA-BCDE9"
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Make sure to copy the formula down in to all cells.

  7. #7
    Registered User
    Join Date
    09-25-2013
    Location
    myob,ok
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Calling data from another sheet with an if function or macro

    Thank you. It works.

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Calling data from another sheet with an if function or macro

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Macro exits prematurely from function after calling other function
    By LouisPhilippe in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2013, 03:22 AM
  2. [SOLVED] help with calling a function (B) and return control of program flow to the calling functio
    By john/nyc in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-26-2012, 11:06 AM
  3. Calling function on button from excel sheet
    By shantanuk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2012, 03:20 AM
  4. IF function calling a Macro ???
    By SportyJim1979 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-15-2012, 04:25 PM
  5. Calling a function in Sheet 1 from UserForm
    By kapilrakh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2009, 08:46 AM

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