I am working on creating a macro. I want to go through the sheet and take the quantity that enter in the cell and copy and insert the row as many times as the value that enter in the cell. How do I convert the number in the cell into integer so I could use it as a counter. For example, cell(1,1) has the number 4 in it, so I want to copy the entire row and paste it 4 times. My code doesn't work because when I used Cell(1,i).value it doesn't convert it into integer. Would you please tell me how do I convert the value inthe cell into integer? Thank you very much, any help would be appreciated.
Dim LastLine As Integer, i, i1 As Integer
Dim qty As Integer
LastLine = Cells(Columns("A").Rows.Count, 1).End(xlUp).Row
For I = 1To LastLine
qty = (Cells(1, i).Value)
If (Cells(1, i).Value) > 1 Then
For i1 = 1 To qty
Cells(1, i).FormulaR1C1 = "1"