Related:
- How to get a value in a cell n times
- How to change time in whatsapp - Guide
- Thinkpad blinks 3 times when plugged in ✓ - Hardware Forum
- What function can automatically return the value in cell c77 ✓ - Excel Forum
- How to insert rows in excel automatically based on cell value without vba ✓ - Excel Forum
- How to block certain apps at certain times - Guide
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?