lordterrin
Board Regular
- Joined
- Mar 21, 2012
- Messages
- 155
Hi there,
I'm using the following formula in cell D6 of my sheet:
which is working perfectly
- - - until I execute this line in the VBA code:
The purpose of this is to do a vlookup on a large range of data, and return "yes" or "no" against all 5000 cells. Now - the autofill "works" in the fact that it copies cell D6 down to whatever the last row is in my sheet, but the problem is that when I select D6 and autofill down, it doesn't change the formula to B6, B7, B8, etc as it goes down the sheet., like a vlookup normally does when you fill down.
In effect, each of the 5,000 cells in the sheet all have the exact same formula in them - all referencing cell B6 on the sheet Test
What am I doing wrong?
I'm using the following formula in cell D6 of my sheet:
Code:
=IF(ISERROR(VLOOKUP("B6",TEST!A:A,1,FALSE)),"NO","YES")
which is working perfectly
Code:
Range("D6").Select
Selection.AutoFill Destination:=Range("D6:D" & ActiveSheet.UsedRange.Rows.Count)
The purpose of this is to do a vlookup on a large range of data, and return "yes" or "no" against all 5000 cells. Now - the autofill "works" in the fact that it copies cell D6 down to whatever the last row is in my sheet, but the problem is that when I select D6 and autofill down, it doesn't change the formula to B6, B7, B8, etc as it goes down the sheet., like a vlookup normally does when you fill down.
In effect, each of the 5,000 cells in the sheet all have the exact same formula in them - all referencing cell B6 on the sheet Test
What am I doing wrong?