Calling a function

bsher

New Member
Joined
Jul 20, 2015
Messages
8
I've got a code that searches a loads database, takes the numbers and puts them into a calculator, gets a number from the calculator and then adds that factored load to another database.

To perform each of the major steps in my code, I call a function. Now when I call each function in order, manually, I get the correct answer I should get according to my hand-calcs. However, when I run them through the macro that calls each function automatically, I start having problems. The final result I get just doesn't make sense, it doesn't come from anywhere in particular and neither does the number.

The code that I have is very large, I'm not sure if anyone would be willing to take a look so I haven't posted it. I can if there's interest.

What I mostly want to know is if excel usually has issues working with large codes that call other functions.
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

oldbrewer

Board Regular
Joined
Apr 11, 2010
Messages
10,990
cells(1,1)=999
call macro2
end sub


macro2 is cells(2,1)=888
call macro 3
end sub

in these terms, what is your question ?
 

DavideG

New Member
Joined
Aug 17, 2013
Messages
9
Usually they work fine. I think yuo need to check ones more your functions and take in consideration that if it is doing different operations you may have to group them.

15 + 10 * 2 = 35
(15 + 10) * 2 = 50

otherwise if you defined some variable as integer will not consider the decimals so you may have to change the datatype. this are the first things that come in my mind.
otherwise you should check step by step your coding to see exactly in which point of the calculations the thing goes wrong.
if you put some coding or more data i think it will be more possible to have someone who gives you the right hint.
 

Watch MrExcel Video

Forum statistics

Threads
1,089,782
Messages
5,410,377
Members
403,316
Latest member
samhadian

This Week's Hot Topics

Top