VBA overflow error Double/Long

epactheactor

New Member
Joined
Sep 9, 2015
Messages
38
Hello!

I'm writing a macro and I keep getting an overflow error. At first I believed it was because I was using Integer and the value was too large for that data type. But I've tried Long and Double to the same error. What am I missing?

Values being used;
material = 35000
txtWT = .5
txtDia = 8.625

This is the formula;

answer = (material/(txtWT * 2)) / txtDia

I split it up to see if maybe that was the problem to this;

X = txtWT * 2
Y = material / X
answer = Y / txtDia

Thank you for any help.
 
Hi shg,

I just figured that out a second before.

Thank you everyone for your help. I was under the impression that you could have the variable be the same at the text box that the data is entered into. I see now this was the issue.

Again, thank you everyone for your help.
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,908
Messages
6,175,304
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top