Macro copy and paste in next blank cell

Solved/Closed
fhernnet - May 3, 2010 at 03:12 AM
pratheepM7 Posts 1 Registration date Tuesday December 6, 2016 Status Member Last seen December 6, 2016 - Dec 6, 2016 at 11:49 AM
Hi guys,
I need some helping in excel macro. I have two sheets in a workbook. Sheet1 is for summary and Sheet2 is for the raw data. I need to update/insert/copy data in Sheet2 to Sheet1. Below is the sample macro code:

Sub Summarize()

Range("A6:AT6").Select
Selection.Copy
Sheets("ImprovementLog").Select
Range("B283").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("B283").Select

End Sub

The code above is working but everytime I change data in Sheet2, the Sheet1 only replace its data. What I need is everytime I change data in Sheet2, it should be added (append) in Sheet1. Please help me.
Appreciate your help.


Many thanks and regards,
Fhernnet

Related:

4 responses

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
May 3, 2010 at 07:05 AM
Not entirely sure about your copy part. How ever if you want to paste by appending then you need to know the last used row. Here
Range("B283").Select
you are hard coding the row


this find the last used cell in column B and then select one cell below it
lMaxRows = Cells(Rows.Count, "B").End(xlUp).Row
Range("B" & lMaxRows +1).select
26
wow! thanks! its working now :)
0
Very Nice ...Thanks :)
0