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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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