• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Code Help

K.Johns

New Member
Hi,

This is a great forum. Thanks for organizing. I'm working on a VBA code that has two workbooks. I need data from Book6 sent to Book5. The catch is, there are 2 worksheets in Book6 with data (tab1 and tab2). I need to add the data in the corresponding cells of each tab and have its sum placed in the populate tab of book5. I've attached the sample files here.

Thanks for your help!

K
 

Attachments

  • Book6.xlsx
    9.2 KB · Views: 5
  • Book5.xlsx
    9.4 KB · Views: 5
Sure.

The tabs in Book5 are:
1.) Populate- This is where the final out put will be located. Specifically, with the respect to the example attached in the 1st post, the output will be in D6:D14
2.) Decide- This tells which file should be opened and evaluated with an indicator of "1" in column C. For this example, there is a "1" in C7, next to grapes.
Therefore, the file pertaining to grapes is opened. In the example, the file is "Book6."

The tabs in Book6 are:
1.) Tab1- has statistics for the level of health of say, person 1, in B5:B13
2.) Tab2- has statistics for the level of health of say, person 2, in B5:B13

The desired result:
From Book6-
Tab1, cell B5 = 1
Tab2, cell B5 = 1

I want the sum of Tab1, cell B5 + Tab2, cell B5 =2 [i.e., 1+1=2]
Placed in Book5, Tab Populate, Cell D6.

The idea is repeated such that i= Book6, Tab1, cell B5 to cell B13
j= Book6,Tab2, cell B5 to cell B13

a= Book5, Tab Populate, cell D6 to D14

a= i+j

Please let me know if there is additional clarity needed.

Thanks!
 
Back
Top