How to increment number in a cell after printing on excel -
i wondering if 1 can me. need increment 1 number in cell , clean few textbox after printing. there beforeprint event doesnt want becuase before sheet printed data cleaned, (i apologize english) there way need or better practice it. thank you.
private sub workbook_beforeprint(cancel boolean) [i6] = [i6] + 1 [c11] = "" [c12] = "" range("b16:b27").clearcontents range("c16:c27").clearcontents range("d16:d27") = "" range("h16:h27").clearcontents end sub
to act after printing, need print document via vba's activesheet.printout
inside of beforeprint
event , set cancel true, doesn't run own print too.
private sub workbook_beforeprint(cancel boolean) cancel = true application.enableevents = false activesheet.printout application.enableevents = true [i6] = [i6] + 1 [c11] = "" [c12] = "" range("b16:b27").clearcontents range("c16:c27").clearcontents range("d16:d27") = "" range("h16:h27").clearcontents end sub
Comments
Post a Comment