I have an Excel worksheet that has multiple sections for collecting information from several different sources.
Each section has several rows with an option to add more rows, if necessary, using a command button to run a sub that will add the requested number of rows.
One section deals with tax information, and includes a combo box (cbo) on each row to define tax type and jurisdiction for a defined piece of equipment to determine into which general ledger account to post the tax amount.
The combo boxes are all linked to the same input list, and their linked cell is the row where the cbo is located (the cbo_Tax33 box is in row 33, overlaid on cell K33, and it's linked cell is K33 All relevant cbo are in column K).
When the user selects the appropriate jurisdiction from the cbo list, it calls a function to return the appropriate GL account that goes into the relevant column (in the previous example, the account number would be returned to A33)
The problem I'm facing, is that if I add 50 rows, am I going to have 50 code subs that read:
Private Sub cbo_Tax33_Change()
Cells(33,"A") = fn_Account(33)
End Sub
where the function fn_Account Row parameter gives row of activecell, which is used to get other information needed to determine the account number (State, Zip Code, TaxType, Local vs County vs State, etc..)
Question: Is it not possible to assign the same sub :
Private Sub cbos_Changed()
ro = activecell.row
Cells(ro,"A") = fn_Account(ro)
End Sub
so I don't need to create a seperate one for each cbo on each added row?
TIA...