• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

increment value in same colmun using loop

delta

Member
pls give me a code for vba for increment in value in same column. for your reference i attache the image file.
 

Attachments

  • Capture.JPG
    Capture.JPG
    33.9 KB · Views: 20
Right-click on the sheet concerned's tab and choose View code, then paste the following to where the cursor is flashing:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A2")) Is Nothing Then
  With Range("A3:A10")
    .FormulaR1C1 = "=R[-1]C*(1+6%)"
    .Value = .Value
  End With
End If
End Sub
 
Solution with 100% VBA
Code:
Sub Belle()
Dim cells As Range
    For Each cells In Range("A3:A10")
        cells.Value = cells.Offset(-1, 0).Value + cells.Offset(-1, 0).Value * 6 / 100
    Next
End Sub
 
Back
Top