Hi Guys,
i have a macro that inputs data from one sheet to another and have been trying to get it to repeat based on a cell value everything.
as i want this to create multiple lines every time it loops it just overwrites the first line was input.
i have a macro that inputs data from one sheet to another and have been trying to get it to repeat based on a cell value everything.
as i want this to create multiple lines every time it loops it just overwrites the first line was input.
VBA Code:
Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Cells(lRow, 6).Value = Worksheets("Input").Range("B5").Value
.Cells(lRow, 1).Value = Worksheets("Input").Range("C5").Value
.Cells(lRow, 5).Value = Worksheets("Input").Range("D5").Value
.Cells(lRow, 4).Value = Worksheets("Input").Range("E9").Value
.Cells(lRow, 3).Value = Worksheets("Input").Range("E11").Value
.Cells(lRow, 11).Value = Worksheets("Input").Range("E13").Value
.Cells(lRow, 8).Value = Worksheets("Input").Range("E15").Value
.Cells(lRow, 12).Value = Worksheets("Input").Range("E17").Value
.Cells(lRow, 14).Value = Worksheets("Input").Range("H8").Value
.Cells(lRow, 7).Value = Worksheets("Input").Range("H10").Value
.Cells(lRow, 13).Value = Worksheets("Input").Range("H12").Value
.Cells(lRow, 9).Value = Worksheets("Input").Range("E19").Value
.Cells(lRow, 10).Value = Worksheets("Input").Range("E20").Value
End With
End Sub