Hello everyone,
Here is the code I have so far:
Sub ValuePaste()
Dim loLastRow as Long
ThisWorkbook.ActiveSheet.Range("E7").Copy With
Workbooks("name.xlsx").Worksheets("fees")
loLastRow = .Cells(Rows.Count, 6).End(xlUp).Row + 1
.Range("F" & loLastRow).PasteSpecial Paste:=xlPasteValues
End With
Dim ALastRow as Long
ThisWorkbook.ActiveSheet.Range("J7").Copy With
Workbooks("name.xlsx").Worksheets("fees")
loLastRow = .Cells(Rows.Count, 7).End(xlUp).Row + 1
.Range("A" & loLastRow).PasteSpecial :=xlPasteValues
End With
It basically copies a cell from one workbook and pastes in the first line of another. This repeats 7 more times so everything is in one row. Then we you run the code with another workbook and the data will go into the next row and so on.
Is there a way to make the code shorter or a better way to do it?
Thanks!
Here is the code I have so far:
Sub ValuePaste()
Dim loLastRow as Long
ThisWorkbook.ActiveSheet.Range("E7").Copy With
Workbooks("name.xlsx").Worksheets("fees")
loLastRow = .Cells(Rows.Count, 6).End(xlUp).Row + 1
.Range("F" & loLastRow).PasteSpecial Paste:=xlPasteValues
End With
Dim ALastRow as Long
ThisWorkbook.ActiveSheet.Range("J7").Copy With
Workbooks("name.xlsx").Worksheets("fees")
loLastRow = .Cells(Rows.Count, 7).End(xlUp).Row + 1
.Range("A" & loLastRow).PasteSpecial :=xlPasteValues
End With
It basically copies a cell from one workbook and pastes in the first line of another. This repeats 7 more times so everything is in one row. Then we you run the code with another workbook and the data will go into the next row and so on.
Is there a way to make the code shorter or a better way to do it?
Thanks!