Hi there, this is my first ever post so please be kind. I have a workbook within which i have wrote various subs to do range of things. the part i stuck on is getting a sub to insert a formula into a cell, easy enough i hear you say but theres something not quite right. here is an example of the code
Range("O13").Formula = "=IF(ISBLANK(C12),"",IF(ISERROR(VLOOKUP(C12,INDIRECT("'"&($AG$2-1)&"'!$C:$AG"),12,FALSE)),N12,VLOOKUP(C12,INDIRECT("'"&($AG$2-1)&"'!$C:$AG"),12,FALSE)))
the problem is when this is entered into vba it turns the "'" after INDIRECT into " '" turning half the formula into a 'note/statement'. I've encountered this problem before and just done a work around but this time unfortunately thats not an option.
Hope someone can show me the error of my ways, appreciate any help
Richard Swift
Bookmarks