Hello
I have a table where random records that are automatically inserted when you press the command button 1, with your help I managed to set all columns exept the last column (column O) because I don't kno what shall i do to enter the following formula: = (L7 -SOMA.SE (D7: N7, D7; K7: K7)) + SOMA.SE (D7: N7, D7, N7, N7)
this formula should be inserted in the button code in order to automatically calculate the value of O7 after that when i press the button he must calculate O8 and so on.
it is important to gradually increase the formula references cells +1, so it would be for the cell:
O7 -> = (L7-SOMA.SE (D7: N7, D7; K7: K7)) + SOMA.SE (D7: N7, D7, N7, N7)
cell O8 -> = (L8-(SOMA.SE (D7: N8, D8, K7, K8)) + SOMA.SE (D7: N8, D8, N7, N8))
cell O9 -> = (L9-(SOMA.SE (D7: N9, D9, K7, K9)) + SOMA.SE (D7: N9, D9, N7, N9))
10 cell -> = (L10-(SOMA.SE (D7: N10, D10, K7: K10)) + SOMA.SE (D7: N10, D10, N7, N10))
and so on
already have my button the following code:
Private Sub CommandButton1_Click ()
Range ("c65536"). End (xlUp). Offset (1, 0). Select
ActiveCell = Now
Range ("d65536"). End (xlUp). Offset (1, 0). Select
ActiveCell = Range ("d4"). Value
Range ("k65536"). End (xlUp). Offset (1, 0). Select
ActiveCell = Range ("i4"). Value
Range ("n65536"). End (xlUp). Offset (1, 0). Select
ActiveCell = Range ("i2"). Value
Range ("f65536"). End (xlUp). Offset (1, 0). Select
ActiveCell.FormulaR1C1 = "= VLOOKUP (RC4, Drugs! R3C2: R402C8, 2, FALSE)"
Range ("l65536"). End (xlUp). Offset (1, 0). Select
ActiveCell.FormulaR1C1 = "= VLOOKUP (RC4, Drugs! R3C2: R402C8, 3, FALSE)"
Range ("m65536"). End (xlUp). Offset (1, 0). Select
ActiveCell.FormulaR1C1 = "= VLOOKUP (RC4, Drugs! R3C2: R402C8, 4, FALSE)"
End Sub
Any ideas? I really need you Help.
Bookmarks