Vba to add objects to a userform in excel 2011 for mac

broken image
broken image

Try selecting each push button to see how the “taxes” result column changes. To text this, select the Developer menu, and select Design Mode form the Controls group in the ribbon to disable Design Mode.

broken image

Each of them will initiate a different tax calculation and will write different results into the result column. Once you’re done, you’ll have both push buttons on your sheet. You will see the results show up in column E. Paste the above VBA code below the previous code, and run the script.

broken image

Then the code loops through each of those cells, performs the tax calculation and writes the results into your new column (column 5). This code finds the last row in your sheet of data, and then sets the range of cells (the column with the sales prices) according to the first and last row of data. Set rng = ws.Range(ws.Cells(2, 4), ws.Cells(LastRow, 4)) LastRow = ws.Cells(ws.Rows.Count, StartCell.Column).End(xlUp).Row The following code will accomplish all of these steps. The order of actions your code should take is: In this example, let’s say you want to calculate the 5% taxes paid on the sale of each item. Next, you want to create a new header for the column that will contain your calculation results.