Hi

Starting to enjoy this forum and the quick resposnse from all - thanks.

I have the folowing code for a comand button which works perfectly as it is. what i want to change is that it replaces one of the formalus in the cell for the new row that falls in Column B with this formula: (this is a formula for outo calculation of next number based on the previouse number) - this will increase the indent by one (i.e 1.2 currently to 1.1.1)

=IF(ISERROR(VALUE(SUBSTITUTE(OFFSET(A13,-1,0,1,1),".",""))),"0.0.1",IF(ISERROR(FIND("`",SUBSTITUTE(OFFSET(A13,-1,0,1,1),".","`",2))),OFFSET(A13,-1,0,1,1)&".1",LEFT(OFFSET(A13,-1,0,1,1),FIND("`",SUBSTITUTE(OFFSET(A13,-1,0,1,1),".","`",2)))&IF(ISERROR(FIND("`",SUBSTITUTE(OFFSET(A13,-1,0,1,1),".","`",3))),VALUE(RIGHT(OFFSET(A13,-1,0,1,1),LEN(OFFSET(A13,-1,0,1,1))-FIND("`",SUBSTITUTE(OFFSET(A13,-1,0,1,1),".","`",2))))+1,VALUE(MID(OFFSET(A13,-1,0,1,1),FIND("`",SUBSTITUTE(OFFSET(A13,-1,0,1,1),".","`",2))+1,(FIND("`",SUBSTITUTE(OFFSET(A13,-1,0,1,1),".","`",3))-FIND("`",SUBSTITUTE(OFFSET(A13,-1,0,1,1),".","`",2))-1)))+1)))

heres the code as it is now

Please Login or Register  to view this content.