ok, so i'm working on a balance sheet type of spreadhseet.
i have figured out how to get the results that i want by using a macro, yet am failing at having it replicated on every other (odd) row.
i had thought about just repeating the macro by changing the row number in each instance as there's only 15 lines that i would need to do this for, but that's not working either AND i also thought there would be an easier way to accomplish this.
i am open to any suggestions that you all might have. essentially, the code allows the cell to perform a basic math function unless an alpha designator is placed in a different cell, which in turn, clears its contents and allows the user to manually input the amount.
the code is as follows:
![]()
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("b9:c9")) Is Nothing Then Exit Sub Else If Range("B9").Value = "in" Then Range("E9").ClearContents Range("C9").ClearContents Else Range("E9") = Range("c9").Value * 0.5 End If If Range("B9").Value = "sa" Then Range("F9").ClearContents Range("C9").ClearContents Else Range("F9").ClearContents Range("f9") = Range("c9").Value * 0.05 End If If Range("B9").Value = "pc" Then Range("G9").ClearContents Range("C9").ClearContents Else Range("G9") = Range("c9").Value * 0.05 End If If Range("B9").Value = "bi" Then Range("H9").ClearContents Range("C9").ClearContents Else Range("H9") = Range("c9").Value * 0.4 End If End If End Sub
Bookmarks