Copy values from one sheet to next empty row in another sheet

sofiachr

Board Regular
Joined
Jan 15, 2013
Messages
98
Hi,

I have a first sheet (Sheet1) with information about name in C3, phone number in C4, email in C5 and notes in C6. I want to copy this information to Sheet2 in column A, B, C and D (name, phone, email, notes). I want Excel to find the next empty row based on values in column A and then copy the information to these columns to this row.

I have the below code but something is wrong since my phonenumber in cell C4 is raplacing the name in column A on Sheet2 when I run it.

VBA Code:
Sub Skriv_in()
Dim LastRow As Long
LastRow = Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
Sheets("Sheet1").Range("C3").Copy Sheets("Sheet2").Cells(LastRow, 1)

Dim LastRow2 As Long
LastRow2 = Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Offset(0, 1).Row
Sheets("Sheet1").Range("C4").Copy Sheets("Sheet2").Cells(LastRow2, 1)

End Sub
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Try:
VBA Code:
Sub Skriv_in()
    Sheets("Sheet2").Cells(Sheets("Sheet2").Rows.Count, "A").End(xlUp).Offset(1).Resize(, 4).Value = WorksheetFunction.Transpose(Sheets("Sheet1").Range("C3:C6"))
 End Sub
 
Upvote 0
Try:
VBA Code:
Sub Skriv_in()
    Sheets("Sheet2").Cells(Sheets("Sheet2").Rows.Count, "A").End(xlUp).Offset(1).Resize(, 4).Value = WorksheetFunction.Transpose(Sheets("Sheet1").Range("C3:C6"))
 End Sub
Thank you! Works perfect
 
Upvote 0

Forum statistics

Threads
1,215,741
Messages
6,126,587
Members
449,319
Latest member
iaincmac

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top