vba - Difference between two cells _VBA Excel Mac 2011 -


i want subtract days (todaydate - violationdate) , save answer in difference column. taking account user enter violation date. once user press command button, show answer.

i have used code not giving me answer.

private sub commandbutton1_click()   range("a" & rows.count).end(xlup).offset(1, 0).value = textbox1.text  range("b" & rows.count).end(xlup).offset(1, 0).value = date   range("c" & rows.count).end(xlup).offset(1, 0).value = range("c" & rows.count).end(xlup).offset(0, -1).value - range("c" & rows.count).end(xlup).offset(0,-2).value  end sub 

please help. thank much.

you can use this:

private sub commandbutton1_click()      range("a" & rows.count).end(xlup).offset(1, 0).resize(, 3).value = array(textbox1.text, date, date - cdate(textbox1.text))  end sub 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -