473,382 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Copy and paste in excel with vba

Hello everyone

I have a question??? can excel copy data from mulitiple worksheets then paste it into a summary workbook then every time the orginal file is change or anything is added it also refects on the summary workbook

I appreactice the help
Oct 24 '11 #1
5 2064
Guido Geurs
767 Expert 512MB
It should work when you opens the individual data books and the summary workbook.
Refer the cells in the summary workbook to the cells in the individual data books and save.
Normally by opening the summary workbook, the data books will also open and the cells in the summary workbook will be updated.
Oct 25 '11 #2
Okay So when i open the origial file it will update the summary workbook? What if i have all in the same workbook will it still up date all records in that summary sheet?
Oct 25 '11 #3
This is as close as i got to merge documents in the same folder they all have the same headings also do you know what i am doing wrong???
Thaniks in advance...
  1. Dim wbkTarget As Workbook
  2. Dim wbkSource As Workbook
  3. Dim strSource As String
  4. Dim strPathName As String
  5. Dim lngSheetNumber As Long
  6. strPathName = "C:\Users\PLS4\Desktop\Client - Copy"
  7. Set wbkTarget = Workbooks.Add
  8. Application.DisplayAlerts = False
  9. Do Until wbkTarget.Sheets.Count = 1
  10. wbkTarget.Sheets(2).Delete
  11. Loop
  12. Application.DisplayAlerts = True
  13. lngSheetNumber = 1
  14. strSource = Dir(strPathName)
  15. Do Until Len(strSource) = 0
  16. Set wbkSource = Workbooks.Open(strSource)
  17. wbkSource.Sheets(1).Copy
  18. after:=wbkTarget.Sheets(lngSheetNumber)
  19. lngSheetNumber = lngSheetNumber + 1
  20. wbkTarget.Sheets(wbkTarget.Sheets.Count).Name =
  21. wbkSource.Sheets(1).Name
  22. wbkSource.Close SaveChanges:=False
  23. Loop
  24. Application.DisplayAlerts = False
  25. wbkTarget.Sheets(1).Delete
  26. Application.DisplayAlerts = True
  27. End Sub
Oct 25 '11 #4
Guido Geurs
767 Expert 512MB
You want to copy sheet1 from different workbooks into a new workbook???
Oct 26 '11 #5
Yes i world like every sheet sheet from sheet one copied into new summary workbook. I attached a copy of the workBook
Attached Files
File Type: zip Client - Copy (2).zip (499.5 KB, 82 views)
Oct 26 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Faith | last post by:
Hello. I need to take a column from Excel(unknown amount of rows) that will be selected by the user and copy those cells. Then I will need to paste those cells into the first column in a Data...
4
by: Legendary Pansy | last post by:
I was checking out the 101 C# Samples, specifically Windows Forms - Use the Clipboard. I took a look at the code for a while, and I understand what the program is doing with the cut, copy, pasting...
3
by: Rachel Suddeth | last post by:
This may not be the right forum, but it's a problem I chiefly come across when trying to post here. When I do a copy/paste from VS, the text always looks really weird (and even if I'm in an...
2
by: Mansi | last post by:
I'm trying to automate excel from c#. One of the things I need to do is to copy/paste/insert rows in excel via c# code. I tried to do the following: 1) Select a row in excel (a12 to k12) 2)...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
0
by: Richard Crowley | last post by:
I have a dynamically-generated asp web page which uses Office Web Components to display an Excel bar chart of the user-selected data. The page works fine, but the users would like to copy-n-paste...
7
by: VoTiger | last post by:
Hi everyone, i am ttrying to find a way to do the copy / paste between an existing excel file and my flexgrid (in runtime application). But the fact is that i don't know how to proceed. The...
0
by: six888 | last post by:
i need to make a report using excel. im given a few data in excel document for a 1 month report (1 document for each week). each data document have a few work sheet.i need only certain information in...
2
by: OfficeDummy | last post by:
Hi, everyone! Like I mentioned in the thread title, I need to copy&paste data between different workbooks, and it works fine. However, when the data has been copied to the destination workbook,...
8
by: jh | last post by:
I'd like to copy/paste into a listbox during runtime. I can do this for a textbox but can't figure out how to accomplish this for a listbox. Any help? Thanks.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.