Function that automatically clears a cell once its numerical value is added to another cell.

%3CLINGO-SUB%20id%3D%22lingo-sub-1695239%22%20slang%3D%22en-US%22%3EFunction%20that%20automatically%20clears%20a%20cell%20once%20its%20numerical%20value%20is%20added%20to%20another%20cell.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1695239%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20might%20be%20a%20silly%20question%2C%20but%20I%20was%20wondering%20if%20there%20was%20an%20Excel%20function%20that%20allows%20me%20to%20input%20a%20numerical%20value%20into%20one%20cell%2C%20have%20that%20value%20added%20to%20another%20cell%2C%20and%20then%20have%20the%20first%20cell%20clear%20itself%2C%20so%20that%20once%20the%20first%20value%20is%20cleared%20the%20change%20to%20the%20second%20value%20remains.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%20Zaac.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1695239%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20for%20web%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1695357%22%20slang%3D%22de-DE%22%3ESubject%3A%20Function%20that%20automatically%20clears%20a%20cell%20once%20its%20numerical%20value%20is%20added%20to%20another%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1695357%22%20slang%3D%22de-DE%22%3EThis%20could%20be%20done%20with%20VBA.%20However%2C%20as%20far%20as%20I%20know%2C%20Excel%20Web%20cannot%20run%20VBA%20like%20Excel%202016.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Work%20with%20VBA%20macros%20in%20Excel%20for%20the%20%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-gb%2Foffice%2Fwork-with-vba-macros-in-excel-for-the-web-98784ad0-898c-43aa-a1da-4f0fb5014343%3Fui%3Den-us%26amp%3Brs%3Den-gb%26amp%3Bad%3Dgb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.microsoft.com%2Fen-gb%2Foffice%2Fwork-with-vba-macros-in-excel-for-the-web-98784ad0-898c-43aa-a1da-4f0fb5014343%3Fui%3Den-us%26amp%3Brs%3Den-gb%26amp%3Bad%3Dgb%3C%2FA%3E%20web%20%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-gb%2Foffice%2Fwork-with-vba-macros-in-excel-for-the-web-98784ad0-898c-43aa-a1da-4f0fb5014343%3Fui%3Den-us%26amp%3Brs%3Den-gb%26amp%3Bad%3Dgb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.microsoft.com%2Fen-gb%2Foffice%2Fwork-with-vba-macros-in-excel-for-the-web-98784ad0-898c-43aa-a1da-4f0fb5014343%3Fui%3Den-us%26amp%3Brs%3Den-gb%26amp%3Bad%3Dgb%3C%2FA%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20maybe%20someone%20else%20has%20a%20better%20idea%20and%20can%20help%20you%20more%20than%20I%20can.%20Wish%20you%20a%20pleasant%20day%20%2F%20night.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%20I%20would%20be%20happy%20to%20know%20if%20I%20could%20help.%20%3CBR%20%2F%3E%20Nikolino%20%3CBR%20%2F%3E%20I%20know%20I%20don't%20know%20anything%20(Socrates)%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hi,

 

This might be a silly question, but I was wondering if there was an Excel function that allows me to input a numerical value into one cell, have that value added to another cell, and then have the first cell clear itself, so that once the first value is cleared the change to the second value remains.

 

Thanks, Zaac.

4 Replies
Highlighted
This could be done with VBA. However, as far as I know, Excel Web cannot run VBA like Excel 2016.

Work with VBA macros in Excel for the web
https://support.microsoft.com/en-gb/office/work-with-vba-macros-in-excel-for-the-web-98784ad0-898c-4...

Maybe someone else has a better idea and can help you more than I can. Wish you a pleasant day / night.

I would be happy to know if I could help.
Nikolino
I know I don't know anything (Socrates)
Highlighted
Here is a small approach if you want to do it with VBA under Excel 2016/2019, etc.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngc As Range, tmp As String
Application.EnableEvents = False
If Not Intersect(Target, Range("B2")) Is Nothing Then
Set rngc = Range("A:A").Find(What:=Target.Value, lookat:=xlWhole)
If Not rngc Is Nothing Then
tmp = Target.Value
Target.Clear
Rows(rngc.Row).Delete
'or if the found line should not be deleted: rngc.Clear
Else
MsgBox tmp & vbLf & "not in column A available!"
End If
End If
Application.EnableEvents = True
End Sub

Nikolino
I know I don't know anything (Socrates)
Highlighted

@Nikolino  @Sergei Baklan 

 

That's excellent, thank you very much. I appreciate the quick responses.