Cells copying and pasting in a empty cell of another sheet

Solved/Closed
Parker - Jan 7, 2020 at 09:46 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jan 30, 2020 at 11:36 AM
Hello,

One Excel file has 2 Sheets. First sheet called "source" and second one called "Bestand"
In sheet "source" one cell (a1 for example) must be copied and paste in sheet "bestand" in row 1.
In Row 1, I could have already datas in cells a1,b1,c1,...., cn. So pasting must be done in the next free cell of row1

How can i do this with VBA-Macro?

Thanks


System Configuration: Windows / Edge 17.17134

1 response

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 555
Jan 30, 2020 at 11:36 AM
Hi Parker,

The following VBA code will do as requested:
Sub RunMe()
Sheets("Bestand").Cells(1, Columns.Count).End(xlToLeft).Offset(0, 1).Value = Sheets("Source").Range("A1").Value
End Sub


Best regards,
Trowa
1