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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -