0

Basically what I want to do is to display values in specific column only if the row(B5) is highlighted(Hereinafter column E) . And if it is highlighted then multiply column C by D.

Could anyone please help me out? Thanks

1

1 Answer 1

0

You didn't say whether or not you can use macros. If you can, this is what I'd use:

Option Explicit

Dim TCol As Integer

Dim TRow As Integer

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
  If TCol = 5 Then Range("E" & TRow).Value = ""

  TCol = Target.Column
  TRow = Target.Row

  If TCol = 5 Then Range("E" & TRow).Value = Range("C" & TRow).Value * Range("D" & TRow).Value

End Sub

The TCol and TRow variables must remain outside the SheetSelectionChange (under Option Explicit) so they remain active and aren't redeclared to 0 each time a new cell is clicked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .