Adding to a data list

drag-driver

Board Regular
Joined
Feb 18, 2002
Messages
91
I need to be able to add data from one list onto the bottom of another list.ie adding data gerenrated in a program to a history list. Does anyone have any ideas ?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
This will not work because i want it to do this automaticaly and constantly update a data file, if i use a copy paste function it will not add to the list it will overwrite the previous data, each time i add to the history file. A macro recorded with copy paste just over wites the previous data.
 
Upvote 0
i need to have the process automated so i want it to add to the end of the history file which will vary in lenght i want it to select the right paste area, ie apending to the end of the history data sheet each time the program is run.
 
Upvote 0
I know there are other ways, but this should work you'll have to play around with the cell reference.

Use a named cell reference in to indicate the end of your sheet. Use that reference in the Macro, then offset and insert the copied cells. do it so the named reference gets pushed to the bottom every time.

This sort of works (below) I didn't have time to get it to work properly.
It opens a file copies a range closes the book then opens the destination book selects the named reference and pastes (thats the part you'll have to play around with)

Workbooks.Open Filename:="C:My DocumentsKNROW COUNT.XLS"
Range("A1651:A1665").Select
Selection.Copy
ActiveWindow.Close
Workbooks.Open Filename:="C:My DocumentsKNcopypastetobottom.xls"
Range("blankline").Select
''ActiveCell.Offset(-1, 0).Range _("blankline").Select
Selection.EntireRow.Insert
ActiveSheet.Paste
Selection.Insert Shift:=xlDown


Hope it helps

Ziggy
 
Upvote 0
Hi
This is a post I just gave to another question but it might give you some ideas for your own problem.

I'm afraid I am a self-taught macro man so my code would probably be laughed at by proper programmers. Anyhow If I wanted to keep copying rows 1:10 from Book5 to Book6 this is the code I would use.
This goes to the receiving Book6 first to select the cell where you are going to dump, then returns to Book5 to copy the rows needed
The first dump is on line 2 of Book6, thereafter it dumps on the next free row.


Application.ScreenUpdating = False
Windows("Book6").Activate
Count = 0
For Each cell In [A65536:IV65536]
If cell.End(xlUp).Row > Count Then
Count = cell.End(xlUp).Row
End If
Next cell
Range("A" & Count + 1).Select
Windows("Book5").Activate
Rows("1:10").Select
Selection.Copy
Windows("Book6").Activate
ActiveSheet.Paste
Windows("Book5").Activate
Application.CutCopyMode = False
End Sub

Hope this is of some help
Regards
Derek
 
Upvote 0

Forum statistics

Threads
1,223,320
Messages
6,171,434
Members
452,402
Latest member
siduslevis

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