Hi,
I have been using a simple macro (below) to increase the value of cell B3. My spreadsheet is getting more complex and I need to adapt the macro so that it increments the previous cell on the row if there is a 1 in next cell.
So, in column C I have a range C8:C33 where a user can input a value. If they input a 1 the preceding cell should increment by 1. Eg. if a user inserts 1 in cell C10, the macro should increment cell B10 by 1.
Is this possible with VBA?
Thanks
I have been using a simple macro (below) to increase the value of cell B3. My spreadsheet is getting more complex and I need to adapt the macro so that it increments the previous cell on the row if there is a 1 in next cell.
So, in column C I have a range C8:C33 where a user can input a value. If they input a 1 the preceding cell should increment by 1. Eg. if a user inserts 1 in cell C10, the macro should increment cell B10 by 1.
Is this possible with VBA?
Thanks
VBA Code:
Sub increment()
ThisWorkbook.Worksheets("Count").Range("B3").Value = Range("B3").Value + 1
End Sub