Hello,
I am working on code to move details on one sheet to another. I would like details from Sheet5 to populate Sheet7. For example, I would like Columns B-I to automatically populate columns B-I on Sheet7. I tried working on just one column ($E$7:E7 on sheet 5) to ($E$8:E8 on sheet7) with this code on sheet7:
Sub copyColumns()
Dim dataSheet As Worksheet
Dim target As Worksheet
Dim rowStartD As Integer
Dim rowStartT As Integer
Dim rowEndD As Long
Set dataSheet = ThisWorkbook.Sheets("Sheet5")
Set target = ThisWorkbook.Sheets("Sheet7")
rowStartD = 7
rowStartT = 8
rowEndD = dataSheet.Cells(Rows.Count, "E").End(xlUp).Row
With dataSheet
.Range(.Cells(rowStartD, 7), .Cells(rowEndD, 8)).Copy (target.Cells(rowStartT, 1))
End With
End Sub
No luck . Should this code be on Sheet5? I already have so much coding, I would like to avoid adding more to sheet5 codes. HELP! Your help is greatly appreciated!! Thanks, Gurus!
Novice
I am working on code to move details on one sheet to another. I would like details from Sheet5 to populate Sheet7. For example, I would like Columns B-I to automatically populate columns B-I on Sheet7. I tried working on just one column ($E$7:E7 on sheet 5) to ($E$8:E8 on sheet7) with this code on sheet7:
Sub copyColumns()
Dim dataSheet As Worksheet
Dim target As Worksheet
Dim rowStartD As Integer
Dim rowStartT As Integer
Dim rowEndD As Long
Set dataSheet = ThisWorkbook.Sheets("Sheet5")
Set target = ThisWorkbook.Sheets("Sheet7")
rowStartD = 7
rowStartT = 8
rowEndD = dataSheet.Cells(Rows.Count, "E").End(xlUp).Row
With dataSheet
.Range(.Cells(rowStartD, 7), .Cells(rowEndD, 8)).Copy (target.Cells(rowStartT, 1))
End With
End Sub
No luck . Should this code be on Sheet5? I already have so much coding, I would like to avoid adding more to sheet5 codes. HELP! Your help is greatly appreciated!! Thanks, Gurus!
Novice