Hello,
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.
Sub findQty()
Dim LastLine As Integer, i, i1 As Integer
Dim qty As Integer
Sheets("List").Activate
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
Rows("7:7").Select
Selection.Copy
Selection.Insert Shift:=xlDown
Cells(1, i).FormulaR1C1 = "1"
Next i1
End if
Next i
Configuration: Windows XP Firefox 2.0.0.16