I have a situation here. There is a excel sheet in which lets say cell A1 as following formula.
=(IF(ISERROR(VALUE(SUBSTITUTE(OFFSET(B10,-1,0,1,1),".",""))),1,IF(ISERROR(FIND("`",SUBSTITUTE(OFFSET(B10,-1,0,1,1),".","`",1))),VALUE(OFFSET(B10,-1,0,1,1))+1,VALUE(LEFT(OFFSET(B10,-1,0,1,1),FIND("`",SUBSTITUTE(OFFSET(B10,-1,0,1,1),".","`",1))-1))+1)))
I am writing a sub to put this same formula in the active /selected cell however while doing so, VBA encounter error since while reading "." in the formula , it expect
The code is reproduced below. I am simply trying to put a formula which otherwise is used directly in excel but this time via a button which will put this formula in an active cell. How can I do that?
Sub fillmainwbs()
ActiveCell.Formula = "=(IF(ISERROR(VALUE(SUBSTITUTE(OFFSET(B10,-1,0,1,1),".",""))),1,IF(ISERROR(FIND("`",SUBSTITUTE(OFFSET(B10,-1,0,1,1),".","`",1))),VALUE(OFFSET(B10,-1,0,1,1))+1,VALUE(LEFT(OFFSET(B10,-1,0,1,1),FIND("`",SUBSTITUTE(OFFSET(B10,-1,0,1,1),".","`",1))-1))+1)))"
End Sub