Erase a cell by pressing a button in Excel -


i'm working in excel. i'd press button cancel value of cell @ left of button itself.

so user experience should following:

when user presses "button1", cell @ left became 0. same "button2" , "button3" how can do? using macro?

assign macro , buttons, , it'll delete info. in cell directly left.

sub test()     dim btnrow&, btncol&     btnrow = activesheet.shapes(application.caller).topleftcell.row     btncol = activesheet.shapes(application.caller).topleftcell.column     cells(btnrow, btncol).offset(0, -1).clearcontents end sub 

or, @rory, can be:

sub test()     activesheet.shapes(application.caller).topleftcell.offset(0,-1).clearcontents end sub 

note: make sure shapes placed, uses wherever top left of shape determine row/column. macro reduces need run 3 different ones, depending on where, , minimizes if/then type statements uses caller determine shape, determines is.


Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -