# Trying to write a VLOOKUP with variables causes RC[1] to not be recognized as a cell refer

1. ## Trying to write a VLOOKUP with variables causes RC[1] to not be recognized as a cell refer

Hello,

The code will successfully open files in alphabetical order of name and perform vlookups based on the values in column B. I am having trouble just with one piece of the code. I want to subtract the value in the column to the left from each value. Here is the code I am having a problem with:

It works without the last part:

But I need to subtract the values.

Thanks in advance for help. Here is the full code:

2. ## Re: Trying to write a VLOOKUP with variables causes RC[1] to not be recognized as a cell r

Bumping..........

Try this...

4. ## Re: Trying to write a VLOOKUP with variables causes RC[1] to not be recognized as a cell r

Hey, thanks. That does work, however I just realized that I am trying to subtract every value that is to the left of the cell. So that if that if there were two cells of information to the left of the current cell, both would be subtracted:

2 3 =x-(2+3) =y-(2+3+x)

Do you or anyone else have any clue how to write a formula that would do this>?

5. ## Re: Trying to write a VLOOKUP with variables causes RC[1] to not be recognized as a cell r

Originally Posted by RichFroning
Hey, thanks. That does work, however I just realized that I am trying to subtract every value that is to the left of the cell. So that if that if there were two cells of information to the left of the current cell, both would be subtracted:

2 3 =x-(2+3) =y-(2+3+x)

Do you or anyone else have any clue how to write a formula that would do this>?
I don't follow.

6. ## Re: Trying to write a VLOOKUP with variables causes RC[1] to not be recognized as a cell r

Oops. Those were meant to look like cells. I want to find the change each day in a number that is a total. So if on the first 3 days of the month it is
3,5,10, I want the cells to read 3,2,5. The issue is that just subtracting the previous cell the way it is now would give you 3, 2, 8.

There are currently 1 users browsing this thread. (0 members and 1 guests)