0

I have the following variables in use in a set of subs:

Public WeightCap As Double  ' Weight capacity
Public HeightCap As Double  ' Height capacity
Public WeightRunning As Double  ' Weight running total
Public HeightRunning As Double  ' Height running total
Public WeightRunningCheck As Double  ' Weight running total for check
Public HeightRunningCheck As Double  ' Height running total for check

With these, I'm trying to call the RTFiller sub as follows:

HeightRunningCheck = HeightRunning + wsStacker.Cells(iSrcCountLine + 1, 12).Value
WeightRunningCheck = WeightRunning + wsStacker.Cells(iSrcCountLine + 1, 13).Value
RTFiller(HeightRunningCheck, WeightRunningCheck)

The RTFiller sub is defined thus:

Private Sub RTFiller(HeightTot As Double, WeightTot As Double)

However, trying to run it prompts a syntax error on the RTFiller(HeightRunningCheck, WeightRunningCheck)line, and when I try to debug it I get "Compile error: Expected: ="

I must have forgotten something obvious and vital, but I can't for the life of me figure out what. Any help?

1 Answer 1

2

You either use:

Call RTFiller(HeightRunningCheck, WeightRunningCheck)

or:

RTFiller HeightRunningCheck, WeightRunningCheck

Unless you use Call, or are returning a value from a function (or are specifically trying to dereference/evaluate one of the parameters) you don't use parentheses.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.