Question: I have an Excel sheet where I have different numbers in range A1 to A10. I need to take the value from the cell and add that many rows under that cell.

Lets say A1 as 3 as value and macro should add 2 rows below A1.

I have tried using "Rows" function but I couldn't find a way out.

Please help.

Answer: 
This should get you going. Let me know if you need any further help.

```
Sub CellsValue()
    Dim Colm As Integer
    Dim lastrow As Long, deflastrow As Long

    'Get the Position of the Required column which has the numbers that it has to shift towards
    Colm = WorksheetFunction.Match("Cells Value", Sheets("Sheet1").Rows(1), 0)

    'Get the lastrow of that column
    lastrow = ActiveSheet.Cells(Rows.Count, Colm).End(xlUp).Row
    deflastrow = Application.Sum(Range(Cells(1, Colm), Cells(lastrow, Colm)))

    For i = 2 To deflastrow + lastrow
        Range("A" & i + 1).Select
        InsertRow = Range("A" & i).Value

        If InsertRow > 0 Then
            InsertRow = InsertRow - 1
        End If

        If InsertRow = 0 Then
            Range("A" & i + 1).Select
        Else
            For j = 1 To InsertRow
                Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
            Next
        End If
    Next
End Sub

```

I have made the change. Now it will work. Kindly accept the answer if it works for you.
Alternate solution:

```
Sub tgr()

    Dim ws As Worksheet
    Dim i As Long

    Const sCol As String = "A"

    Set ws = ActiveWorkbook.ActiveSheet
    For i = ws.Cells(ws.Rows.Count, sCol).End(xlUp).Row - 1 To 1 Step -1
        With ws.Cells(i, sCol)
            If IsNumeric(.Value) Then
                If .Value - 1 > 0 Then .Offset(1).Resize(.Value - 1).EntireRow.Insert xlShiftDown
            End If
        End With
    Next i

End Sub

```