Forum Discussion
Auto Fill Error when output data are less than 1
Hi Sonal2309
The trouble is not with the code that you posted but in the previous line:
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC1,Sheet3,2,0)"
This line creates an error in the field D2. Then you tell Excel to fill-down the error which Excel refuses to do.
To check it yourself, while in Excel, press ALT+F11 and it will open VBA editor. Then use F8 to go line by line and watch you spreadsheet as you keep pressing F8.
I would correct your code, but I don't know how exactly your VLOOKUP works.
For start, look for VBA examples of VLOOKUP.
If you give me more details, maybe I can fix it for you.
peanut Thank you but I know that the error is not in Vlookup and it is in Autofill (Please check the subject line of my query carefully). Although I used record macro to make the coding I know how to edit & so I was seeking help for it.
I have used the IF condition and resolved the error.