VBA: Input new data to another datatable.

Xiangwu

New Member
Joined
Feb 17, 2014
Messages
25
Hi, All,

I'm trying to edit a macro that allows me to copy data from "Input" sheet and send it to the "Data" sheet.


As for now, the code copies A3:A5 in "Input", and pastes to the empty rows. Now, I'd like to change the row count to column count as copying A3:D3 in "Input", and carrying them to the empty rows "A:D" in "Data. I'm still learning VBA, so I really dont know how to achieve so.

The code is:

Code:
Sub CopyData()

Dim lr As Long
Sheets("Data").Visible = True
lr = Sheets("Data").Cells(Rows.Count, "A").End(xlUp).Row
Sheets("Input").Range("A3:A5").COPY
Sheets("Data").Range("A" & lr + 1).PasteSpecial Paste:=xlPasteValues
Sheets("Input").Range("A6").Select

End Sub

Please share your ideas, and thank you guys so much.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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