excel - Update cell when DELETE pressed -


i have below data:

mon    tue    total 2      5       25 5      0       50 54     85      5485 

at moment concatenate total using mon & tue. works fine using on change event when double clicking in cell or pasting values in mon , tue.

however, there way of reflecting changes when delete button pressed? when delete, clear total cells. if delete mon, have 5 , if delete mon , tue, empty cell first row etc...

upd: current code is:

private sub worksheet_change(byval target range)     dim lnglastrow long     lnglastrow = cells(rows.count, "a").end(xlup).row     worksheets(1).range("d2:d" & lnglastrow).value = evaluate("=a2:a" & lnglastrow & "&""""&" & "b2:b" & lnglastrow) end sub 

found solution:

if not intersect(target, range("a:a", "b:b")) nothing  range("d2:d" & myrange).value = myvalue   end if  

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -