Hi ,
I have the data set
<colgroup><col width="64" span="6" style="width:48pt"> </colgroup><tbody>
</tbody>
At the moment my code copies the information from row 1. However, I need this to happen for the last row of a spreadsheet. As the last row differs from each spreadsheet.
Can someone help amend my code below so it is able to function for data until the last row ?
Thanks in advanced.
<colgroup><col><col><col><col><col><col><col span="2"><col><col><col><col><col><col><col></colgroup><tbody></tbody>
I have the data set
COL A | COL B | COL C | COL D | COL E | |
ROW1 | DATA | DATA | DATA | ||
ROW2 | DATA | DATA | DATA | ||
ROW3 | DATA | DATA | DATA | ||
ROW4 | DATA | DATA | DATA | ||
ROW5 | DATA | DATA | DATA | ||
ROW6 | DATA | DATA | DATA | ||
ROW7 | DATA | DATA | DATA |
<colgroup><col width="64" span="6" style="width:48pt"> </colgroup><tbody>
</tbody>
At the moment my code copies the information from row 1. However, I need this to happen for the last row of a spreadsheet. As the last row differs from each spreadsheet.
Can someone help amend my code below so it is able to function for data until the last row ?
Code:
Sub data()
'copying projects
ActiveSheet.Range("A3:L3").Copy
Sheets("Sheet4").Range("N1").End(xlDown).Offset(1, -13).PasteSpecial Paste:=xlPasteValues
With Sheets("sheet1")
Set rng = .Range(.Cells(1, 15), .Cells(1, .Cells(1, .Columns.Count).End(xlToLeft).Column))
Set rng1 = .Range(.Cells(2, 15), .Cells(2, .Cells(2, .Columns.Count).End(xlToLeft).Column))
Set rng_3 = .Range(.Cells(3, 13), .Cells(3, .Cells(3, .Columns.Count).End(xlToLeft).Column))
End With
'copying roles and planned hours
rng.Copy
Sheets("Sheet4").Range("N1").End(xlDown).Offset(0, -1).PasteSpecial xlValues, Transpose:=True
rng1.Copy
Sheets("Sheet4").Range("N1").End(xlDown).Offset(1, 0).PasteSpecial xlValues, Transpose:=True
'copy_actual hours
rng_3.Copy
Sheets("Sheet4").Range("N1").End(xlDown).Offset(-51, 1).PasteSpecial xlValues, Transpose:=True
End Sub
Thanks in advanced.
<colgroup><col><col><col><col><col><col><col span="2"><col><col><col><col><col><col><col></colgroup><tbody></tbody>