Type Mismatch Error

J

JimFor

Hi,

I have been working developing a VBA program which takes an inventory amount on
sheet 1, adds and subtracts to that number period transaction data found on
sheet2 and comes up with a Beginning Inventory Amount, Transaction Activity and
Ending Inventory Amount for accounts for a particular time period-sheet3. I
have learned much from books and this board and (so far have) gotten the
program to work....EXCEPT for the last account number in my test data.

My test data consists of 18 transactions for 4 accounts and beginning inventory
data for the accounts. The program uses a VLOOKUP function to determine the
starting inventory level for any account. I get a "Type Mismatch-Error 13"
message when the program is to calculate the beginning inventory level for the
last account. The program is to put any inventory amount it finds(via the
VLOOKUP function) in sheet1 (the beginning inventory level) onto sheet3 as the
first line of data for an account. It has worked for the other three accounts.
But the program stops for the last account. It puts a "N/A" in the cell which
should contain the beginning inventory level and no longer processes the last
account's transaction data, no matter how many transactions I instruct it to
look at. I get the error message and the "N/A." The data does not look any
different than the other data.

Can anyone tell me what might be causing this problem and what I can to do fix
it. Thanks in advance. May not be able to reply to the post because AOL's
newsreader is broken but I will read any reply on Google. (Was told about an
Outlook Express possible workaround to the AOL problem and will try that when
time permits.)

Thanks
 
T

Tom Ogilvy

Vlookup returns a #N/A when it doesn't successfully find the value being
searched for. I suggest you use vlookup in the worksheet itself and get it
working for this last value. Then see if you can get it working with your
code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top