Hello all!
First I'd like to thank everyone in advance who helps me out with this! I don't know where I'd be in life without this forum, you guys are all absolute geniuses!
So now to my questions.
I am trying to create some vba code and I'm fairly new to this. I am trying to create a code that uses a vlookup formula based on a certain condition (IF statement).
There are two parts to my code.
First, I want the code to scan all of my data and if the word "Freight" appears in column F, I want a Vlookup to be performed in the same row but in column H. In the rows where the word "Freight" does not appear, I don't want anything done because there will already be data in those cells.
Here is what the formula would look like if not done in VBA. This causes a circular reference that I would prefer not to have.
=IF($F1="Freight",VLOOKUP($E1,'Summary Invoicing'!$F:$P,11,FALSE),$H1)
In the second part of my code I want it to once again scan all of my data and if the word "Freight" appears in column F, I want a Vlookup to be performed in the same row but in column I. If the word "Freight" does not appear in column F, I want it to remain blank.
Here is what the formula would look like if not done in VBA.
=IF($F1="Freight",VLOOKUP($E1,'HJ Tracking Numbers'!$B:$F,5,FALSE)," ")
Thanks so much!
First I'd like to thank everyone in advance who helps me out with this! I don't know where I'd be in life without this forum, you guys are all absolute geniuses!
So now to my questions.
I am trying to create some vba code and I'm fairly new to this. I am trying to create a code that uses a vlookup formula based on a certain condition (IF statement).
There are two parts to my code.
First, I want the code to scan all of my data and if the word "Freight" appears in column F, I want a Vlookup to be performed in the same row but in column H. In the rows where the word "Freight" does not appear, I don't want anything done because there will already be data in those cells.
Here is what the formula would look like if not done in VBA. This causes a circular reference that I would prefer not to have.
=IF($F1="Freight",VLOOKUP($E1,'Summary Invoicing'!$F:$P,11,FALSE),$H1)
In the second part of my code I want it to once again scan all of my data and if the word "Freight" appears in column F, I want a Vlookup to be performed in the same row but in column I. If the word "Freight" does not appear in column F, I want it to remain blank.
Here is what the formula would look like if not done in VBA.
=IF($F1="Freight",VLOOKUP($E1,'HJ Tracking Numbers'!$B:$F,5,FALSE)," ")
Thanks so much!