Related:
- How to get a value in a cell n times
- How to change time in whatsapp - Guide
- Times attack - Download - Children
- Based on the values in cells b77:b81, what function can automatically return the value in cell c77? ✓ - Excel Forum
- You've tried to log in too many times. to protect your account, a temporary block has been placed on logging in. please try again later. ✓ - Facebook Forum
- Facebook account is Temporary blocked - Facebook Forum
1 response
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Jan 20, 2011 at 04:38 AM
Jan 20, 2011 at 04:38 AM
suppose your data is like this from A1 to C2
Salary Months Increment
1000 4 50
try this macro
Salary Months Increment
1000 4 50
try this macro
Sub test() Dim r As Range, mo As Integer, inc As Long, m As Integer Dim dest As Range Set r = Range("A2") mo = Range("B2").Value inc = Range("c2").Value Set dest = Range("A10") Range(dest, dest.Offset(mo - 1, 0)).Cells.Value = r.Value m = 2 Do If m > 15 Then Exit Do Set dest = dest.End(xlDown).Offset(1, 0) Range(dest, dest.Offset(mo - 1, 0)).Cells.Value = r.Value + (m - 1) * inc m = m + 1 Loop End Sub
Jan 20, 2011 at 05:05 AM
Could you manage to provide some manual to learn VB?