I have a a file in excel that contains a different sheet for each project and a sheet for a purchase order listing. I can't run a project report that lists vendor names, but I can run a project report that lists purchase orders and then run a purchase order lisiting. So, I need to have a macro run through my project report and match the purchase order on the report to the purchase order listing, grab that vendor name and insert it into a new row in the project report file. I would like to manually run the macro for each project sheet.
I need a macro that I can run to do the following:
Search in column "E" of my project report for a purchase order number (some will be empty)
Search in column "H" of the purchase order listing in the same workbook. It is named "Download" for the same purchase order number
Insert a column after column "E" in my project report titled "Vendor"
Insert the corresponding Vendor name from column "F" of the "Download" (purchase order) sheet in the new column.
If there is no purchase order, I need the Vendor column to be blank.
I'm really not good with creating macros. Here is what I have, but it's not working. I got this from another macro I use and tried to adjust it for my needs. Can anyone help? When I run this macro, it inserts the column, but doesn't put a vendor name in the inserted column.
Sub Vendor()
Columns("F").EntireColumn.Insert
Range("F1") = "Vendor"
Range([F4], [F65536].End(xlUp)).Offset(, 1) = _
"=VLOOKUP(F4,'Download'!$H$2:$F$2000,3,false)"
End Sub
Edited because I figured out part of my error, but it still doesn't work.
I need a macro that I can run to do the following:
Search in column "E" of my project report for a purchase order number (some will be empty)
Search in column "H" of the purchase order listing in the same workbook. It is named "Download" for the same purchase order number
Insert a column after column "E" in my project report titled "Vendor"
Insert the corresponding Vendor name from column "F" of the "Download" (purchase order) sheet in the new column.
If there is no purchase order, I need the Vendor column to be blank.
I'm really not good with creating macros. Here is what I have, but it's not working. I got this from another macro I use and tried to adjust it for my needs. Can anyone help? When I run this macro, it inserts the column, but doesn't put a vendor name in the inserted column.
Sub Vendor()
Columns("F").EntireColumn.Insert
Range("F1") = "Vendor"
Range([F4], [F65536].End(xlUp)).Offset(, 1) = _
"=VLOOKUP(F4,'Download'!$H$2:$F$2000,3,false)"
End Sub
Edited because I figured out part of my error, but it still doesn't work.