vanessaaleks
01-16-2009, 05:30 PM
Hi All,
I am creating a macro to do a vlookup of credit card charges against a traveler report.The spreadsheet I am working with has a changing amount of rows week to week, since the number of trips booked are different all the time. I also have a varying amount of data, and will inevitably have blank information in column E (header is passenger name). My macro sorts the information so that the traveler names that are already pre-filled are at the top. Now I want the macro to continue, but am stumped on how to do the next step. Here's what I want it to do:
Find the first blank cell in column E and enter the formula
=if($C66="TPT",vlookup($D66,Cognos!$B:$E,4,false),vlookup(CyberArc!$D66,Cognos!$D:$F,3,fa lse))
Then I want the formula to be dragged down through to the last row (based on an endrow value from a count of column A)
Also, I'm curious - if it wasn't already sorted so that the blank rows are all together, would there be a way to do this so it would fill in blank cells using the row number the blank cell is in?
Thank you for your help and time.
I am creating a macro to do a vlookup of credit card charges against a traveler report.The spreadsheet I am working with has a changing amount of rows week to week, since the number of trips booked are different all the time. I also have a varying amount of data, and will inevitably have blank information in column E (header is passenger name). My macro sorts the information so that the traveler names that are already pre-filled are at the top. Now I want the macro to continue, but am stumped on how to do the next step. Here's what I want it to do:
Find the first blank cell in column E and enter the formula
=if($C66="TPT",vlookup($D66,Cognos!$B:$E,4,false),vlookup(CyberArc!$D66,Cognos!$D:$F,3,fa lse))
Then I want the formula to be dragged down through to the last row (based on an endrow value from a count of column A)
Also, I'm curious - if it wasn't already sorted so that the blank rows are all together, would there be a way to do this so it would fill in blank cells using the row number the blank cell is in?
Thank you for your help and time.