Macro code to copy and past in new sheet last row of data

Closed
Arg - Mar 24, 2015 at 01:22 PM
vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 - Mar 24, 2015 at 06:51 PM
Hello,

I'm trying to write a simple macro to copy in one sheet a selected amount of column data (which varies by size each time) and then paste the data in another sheet in the last available row. I do this three different times for three different selections in the first sheet, which each go into a separate column in the second sheet. I have the below code so far, but when I run it, it freezes my excel and I need to force restart. I think the problem lies when I try to select the last available cell in my data set.

Range("A3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Master Table").Select
lastRow = Cells(Rows.Count, "B").End(xlUp).Row
Range("B" & lastRow + 1).Select
ActiveSheet.Paste

Any help would be appreciated.
Related:

1 response

vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 259
Mar 24, 2015 at 06:51 PM
Hello Arg,

Just so that we can fully understand your requirements, could you please upload a sample of your work book (be careful with any sensitive data) showing the inputs and the expected result. You can upload a sample by using a free file sharing site such as DropBox or ge.tt.

Someone should then be able to sort this out for you.

Cheerio,
vcoolio.
0