Hi,
New to using VBA and know little about it. Using it for an Engineering project to solve deep seated slope stability problems. When entering in the first 7 calculations VBA solves these correctly in a user form. But when I try to calculate the 8th formula (AVHS8) it gives me an error, witch is run time error "13" type mismatch. I am unsure what the problem is, the formulas work in excel perfectly. if anyone could help it would be much appreciated. The problem is below.
BES, AVHS, DTCP and OH are just numbers that are set and do not change
Private Sub Calculate_Click()
RAD = Sqr(DTCP ^ 2 + OH ^ 2)
BES = DTCP / 3
AVHS1 = (0)
AVHS2 = (Sqr(RAD ^ 2 - (DTCP - BES) ^ 2) - OH)
AVHS3 = (Sqr(RAD ^ 2 - (DTCP - BES - BES) ^ 2) - (OH) + (Tan(30 * 3.14 / 180) * BES))
AVHS4 = (Sqr(RAD ^ 2 - (DTCP - BES - BES - BES) ^ 2) - (OH) + (Tan(30 * 3.14 / 180) * BES * 2))
AVHS5 = (Sqr(RAD ^ 2 - (DTCP - BES - BES) ^ 2) - (OH) + (Tan(30 * 3.14 / 180) * BES * 3))
AVHS6 = (Sqr(RAD ^ 2 - (DTCP - BES) ^ 2) - (OH) + (Tan(30 * 3.14 / 180) * BES * 4))
AVHS7 = (Sqr(RAD ^ 2 - (DTCP) ^ 2) - (OH) + (Tan(30 * 3.14 / 180) * BES * 5))
VBA can solve all the above code. it cant solve the code below (AVHS8)
AVHS8 = (Sqr(RAD ^ 2 - (DTCP + BES) ^ 2) - (OH) + (Tan(30 * 3.14 / 180) * BES * 6))
New to using VBA and know little about it. Using it for an Engineering project to solve deep seated slope stability problems. When entering in the first 7 calculations VBA solves these correctly in a user form. But when I try to calculate the 8th formula (AVHS8) it gives me an error, witch is run time error "13" type mismatch. I am unsure what the problem is, the formulas work in excel perfectly. if anyone could help it would be much appreciated. The problem is below.
BES, AVHS, DTCP and OH are just numbers that are set and do not change
Private Sub Calculate_Click()
RAD = Sqr(DTCP ^ 2 + OH ^ 2)
BES = DTCP / 3
AVHS1 = (0)
AVHS2 = (Sqr(RAD ^ 2 - (DTCP - BES) ^ 2) - OH)
AVHS3 = (Sqr(RAD ^ 2 - (DTCP - BES - BES) ^ 2) - (OH) + (Tan(30 * 3.14 / 180) * BES))
AVHS4 = (Sqr(RAD ^ 2 - (DTCP - BES - BES - BES) ^ 2) - (OH) + (Tan(30 * 3.14 / 180) * BES * 2))
AVHS5 = (Sqr(RAD ^ 2 - (DTCP - BES - BES) ^ 2) - (OH) + (Tan(30 * 3.14 / 180) * BES * 3))
AVHS6 = (Sqr(RAD ^ 2 - (DTCP - BES) ^ 2) - (OH) + (Tan(30 * 3.14 / 180) * BES * 4))
AVHS7 = (Sqr(RAD ^ 2 - (DTCP) ^ 2) - (OH) + (Tan(30 * 3.14 / 180) * BES * 5))
VBA can solve all the above code. it cant solve the code below (AVHS8)
AVHS8 = (Sqr(RAD ^ 2 - (DTCP + BES) ^ 2) - (OH) + (Tan(30 * 3.14 / 180) * BES * 6))