I have a parent Excel workbook that contains multiple columns on the sheet.
There is a 'Total Income' cell per column along with each column having 4 cells for Fed tax, State tax, Medicare, SS.

I have a child Excel workbook (1 sheet) where I have an income cell where if I enter an amount, 4 cells each will calculate the Fed tax, State tax, Medicare, SS amounts respectively.


When the parent is opened, I am looking for the parent to dynamically call the closed child for each of the 4 income cells (passing the parent’s Total Income cell’s amount) and have the child pass back the 4 calculated amounts respectively (Fed tax, Sate tax, Medicare, SS) to the parent and populate each column having 4 cells for the Fed tax, State tax, Medicare, SS.
I am not using VBA. Do I need to and learn it? If so, how do I access that functionality in Excel 2010?
Rajkiran SwainPosted Apr 6, 2023, 11:32 AM
To achieve this functionality, you would need to use VBA code in Excel 2010. Here are the high-level steps that you would need to follow:
Create a button in the parent Excel workbook that would trigger the VBA code.
Write VBA code to open the child Excel workbook, pass the Total Income cell's amount to the child, and get the 4 calculated amounts back from the child.
Use the VBA code to populate the 4 cells for Fed tax, State tax, Medicare, and SS in each column of the parent Excel workbook.
Here is some sample code that demonstrates how to open the child Excel workbook, pass values to it, and get values back:
First LastPosted Apr 13, 2023, 5:54 PM
Ok...almost there.
I have multiple buttons each in its own cell on row 12.
I want to make this a dynamic build of the values in the Range function.
So based on one of the cells that a button is clicked (the button sits in cell C12). I get the 'cell letter'. In this case 'C' is inside the variable 'cellLetter'.
I want to dynamically build the Range with the Range function using that.
incomeCell.Value = ThisWorkbook.Worksheets("ForIrsIncomeAndExpenses").Range(""" & cellLetter & 12").Value
But I get an error. Application-define or object-defined error
Am I concatentating/building the statement in the 'Range' function correctly?
It should build:
incomeCell.Value = ThisWorkbook.Worksheets("ForIrsIncomeAndExpenses").Range("C12").Value