Need to subtract values from Column H from Column G when Column J is clicked through VBA, this will happen for the entire range i.e G4:G76, H4:H76 & J4:J76
if only J4 cell is clicked it will subtract (G4-H4), if J5 cell is clicked it will subtract (G5-H5), if J6 cell is clicked it will subtract (G6-H6) so on and so forth and show the value in single cell "M3"
I tried below code, this macro can be called when any cell in column J is clicked however this displays it in the entire column. I dont need that, only when respective cell in J column is clicked it should display the calculation in cell M3.
Sub FormulasNoLoops()
Dim LastRow As Long
LastRow = Cells(Rows.Count, "G").End(xlUp).Row
Range("M4:M" & LastRow) = Evaluate("G4:G" & LastRow & "-H4:H" & LastRow)
End Sub
Bookmarks