Hi Guys,
I want to make a code to determine the amount of products and reactants at equilibrium. I want the code to be account for as many reactants and products necessary, each reaction will have different numbers so I dont want to to be limited to what reactions I can use. Here is what ive got so far, however I am not sure where to go from here.

Public Function Gibbs_at_ref_TandP(delta_Hr, delta_Sr)
' Products - reactants gives delta_Hr and delta_Sr, make sure units are J/mol.K
'Products and reactants in formation (f), they make reaction (r)
'ref is typically 1atm and 298.15K
'make sure units are J/mol.K
Gibbs_at_ref_TandP = delta_Hr - (298.15 * delta_Sr)
End Function

Public Function refrence_equilibrium_constant_K(delta_Hr, delta_Sr)
R = 8.314 'J/mol.K
a = Gibbs_at_ref_TandP(delta_Hr, delta_Sr)
refrence_equilibrium_constant_K = Exp(-a / (R * 298.15))
End Function

Public Function Vant_Hoff_Equation_K(delta_Hr, delta_Sr, T)
b = refrence_equilibrium_constant_K(delta_Hr, delta_Sr)
c = delta_Hr / 8.314
d = ((1 / T) - (1 / 298.15))
e = c * d
Vant_Hoff_Equation_K = b * Exp(e)
End Function