+ Reply to Thread
Results 1 to 10 of 10

VBA Code to Pull data to another spreadsheet based on conditions!

  1. #1
    Registered User
    Join Date
    10-16-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    11

    VBA Code to Pull data to another spreadsheet based on conditions!

    Hi All,

    I am trying to create a macro that pulls data from one tab to another based on specific criteria. I've attached the file to this posted. In the attached spreadsheet, I am looking to pull the data from the "Fund Information" tab to the "Overview" tab. How I am trying to get this to work is when I set the region and currency in the "Overview" worksheet (cells B2 and C2) I can then run a macro that will:

    1) Pull the fund name in column A of the "Fund Info" tab into the "Overview" tab under the Holdings Summary section (starting at cell A16), based on the criteria selected in cells B2 & C2 in the "Overview" tab

    2) Pull the Investment $ Amount (column H in the "Fund Info" tab) of the specific fund under the corresponding headings in row 3 of the "Overview" tab.

    If someone can point me in the right direction it would help immensely.

    Much appreciated.

    Matt
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code to Pull data to another spreadsheet based on conditions!

    Your worksheet is protected.

  3. #3
    Registered User
    Join Date
    10-16-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: VBA Code to Pull data to another spreadsheet based on conditions!

    There is a macro in the file that breaks the password, just run it on each spreadsheet and it will unlock it for you. Sorry about that

  4. #4
    Registered User
    Join Date
    10-16-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: VBA Code to Pull data to another spreadsheet based on conditions!

    Hi AB33, when i open the file I attached the worksheets are unprotected but the workbook is protected. Do you need the workbook to be unprotected?

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code to Pull data to another spreadsheet based on conditions!

    You have lots of merged cells. I had to unmerge them. I am not sure if the condition is "OR" or "AND".
    The code assumes AND, but can easily change to OR.
    I am not sure I understand your second request as there are no data on column H, but first we need to get the first request right.
    Attached Files Attached Files
    Last edited by AB33; 07-04-2013 at 03:41 PM.

  6. #6
    Registered User
    Join Date
    10-16-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: VBA Code to Pull data to another spreadsheet based on conditions!

    Hi AB33..thanks a lot, it's kind of what I was looking for but I just wanted to show the fund names (items in columns A of the "Fund Info" tab) starting under A12 in the "overview" tab and then the corresponding investment $ amount (column G in the "fund Info" tab) to be put under the proper headings of row 3 on the Overview tab - again all following the conditions of cells B2 & C2 in the overview tab. I know this must sound confusing. I've attached a screen shot of the end result of what I hope the macro can do

    thanks again AB33!


    Mock test (2).xlsMacro Example.doc

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code to Pull data to another spreadsheet based on conditions!

    The code works as long as row 3 heading match with what is in column F.
    Attached Files Attached Files
    Last edited by AB33; 07-05-2013 at 08:36 AM.

  8. #8
    Registered User
    Join Date
    10-16-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: VBA Code to Pull data to another spreadsheet based on conditions!

    AB33 you're the best! Much appreciated!!

  9. #9
    Registered User
    Join Date
    10-16-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: VBA Code to Pull data to another spreadsheet based on conditions!

    See new attachment
    Attached Files Attached Files
    Last edited by mg87; 07-16-2013 at 03:07 PM.

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code to Pull data to another spreadsheet based on conditions!

    Hi mg87,
    You need to open a new thread with new request since your last request was resolved!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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