Copy the Recent Data, without copying or selecting the previous Data.

hennLow

New Member
Joined
Jul 29, 2021
Messages
8
Office Version
  1. 2019
Platform
  1. Windows
Hi Everyone so I have this code that copies everything including the previous data, what I wanted to do is just copy what was added to the previous or existing data.

Sub upload_data_fix()
Dim WScopy As Worksheet
Dim WSdest As Worksheet
Dim desWB As Workbook
Dim FileToOpen As Variant
Dim cRow As Long
Dim Stat As Range


Set desWB = ThisWorkbook
Set WSdest = desWB.Sheets("SHT1")
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for your file & Import Range", FileFilter:="Excel Files (.xls),*xls*")
If FileToOpen = False Then Exit Sub
Set OpenBook = Application.Workbooks.Open(FileToOpen)
With Sheets(26)
cRow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("A8:AA" & cRow).Copy
WSdest.Cells(WSdest.Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValuesAndNumberFormats
End With

End sub
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Looking at the data in your worksheet ... how would you know which data was added to the old ?

Looking at your macro, I do not see anything that would differentiate the old from the new data.

???
 
Upvote 0
Looking at the data in your worksheet ... how would you know which data was added to the old ?

Looking at your macro, I do not see anything that would differentiate the old from the new data.

???
Hi yes I don't have any what I got right now is copy paste function only, I don't know where to start the code since I'm still a beginner
 
Upvote 0
Looking at the data in your worksheet ... how would you know which data was added to the old ?

Looking at your macro, I do not see anything that would differentiate the old from the new data.

???
I am sorry for the misunderstanding that is my code for now, since I don't know where to start
 
Upvote 0
There may be other ways of accomplishing your goal but ... this is the only means I know of ....

You will need to temporarily copy and paste the new data to a separate location as well as adding it to the existing sheet of data. When you want to copy the
new data ... you'll copy the data that was saved to the separate sheet. I presume you will want to delete the data that was saved to the separate sheet, in preparation
for the next "new data" being pasted to both locations.

If you describe in more detail what it is you are attempting to accomplish and provide an example workbook with sample data showing a BEFORE and AFTER
layout with the data ... that would assist greatly.

This forum doesn't provide a means of attaching a workbook so you will need to upload to a cloud site (dropbox.com, etc) and provide the link for download here.
 
Upvote 0
There may be other ways of accomplishing your goal but ... this is the only means I know of ....

You will need to temporarily copy and paste the new data to a separate location as well as adding it to the existing sheet of data. When you want to copy the
new data ... you'll copy the data that was saved to the separate sheet. I presume you will want to delete the data that was saved to the separate sheet, in preparation
for the next "new data" being pasted to both locations.

If you describe in more detail what it is you are attempting to accomplish and provide an example workbook with sample data showing a BEFORE and AFTER
layout with the data ... that would assist greatly.

This forum doesn't provide a means of attaching a workbook so you will need to upload to a cloud site (dropbox.com, etc) and provide the link for download here.
Hi I see, what I wanted to achieve is I have a existing data, and every month the data I have will have an additional data from the recent month. for example I have a data from jan - jul this month It will have a added data from august. I just wanted to copy the august data. I tried the max function, its just that I dont know how to apply or get the data or us the max function.
 
Upvote 0
Post to a 'download site' a copy of your workbook. Do not include any confidential information.
In the workbook, provide a "before" and "after" view of the data you are working with.

This will give you a quicker and more accurate answer to your question.
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,822
Members
449,469
Latest member
Kingwi11y

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