Copy cells from all sheets and paste into a single sheet
Hi,
I have many sheets that have the format as the picture below:
I would like to have an excel macro to, for all sheets from the second sheet to the last 4th sheet (ie, the last 3 sheets to be excluded), copy the following into a single sheet named "TB":
(columns in sheet "TB" in the following order)
1) Sheet Name
2) Date from G13
3) Columns A to C from row 22 onwards where column C is not empty
4) Company name
5) Description (which may span from columns D to G, where column C is not empty
6) Period (where column C is not empty)
7) Cheque number (G11 & G11 together into 1 cell if possible)
8) Amount (where column C is not empty)
*Note that the rows from row 22 onwards of source sheet will vary
That is, it should look something like this in sheet "TB":
How do I do this? Please help :(
Thanks!
Solutions to the Problem Copy cells from all sheets and paste into a single sheet
Please help! :(
I had been trying for the past hours.
This is what I tried to start with.
But even this doesn't work...
The error shows on the bold line below: (The error says "Run-time error '1004': Method 'Range' of object'_Worksheet' failed".)
Dim ns As Worksheet
Set ns = Sheets.Add(Before:=Sheets(Sheets.Count + 1)) 'Sheets.Count
ns.Name = "TB"
Dim ws As Worksheet
Dim wsDest As Worksheet
Set wsDest = Sheets("TB")
For Each ws In ActiveWorkbook.Worksheets
If ws.Name <> wsDest.Name Then
ws.Range("A22", Range("C22").End(xlDown).Offset(0, 6)).Copy
wsDest.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
End If
Next ws
But when I tried to isolate it and run as
Activesheet.Range("A22", Range("C22").End(xlDown).Offset(0, 6)).Copy
it gets what I want.
What is wrong with the line above?
Hi SnowPrometheus,
Try changing the line:
ws.Range("A22", Range("C22").End(xlDown).Offset(0, 6)).Copy
to
ws.Range(ws.Range("A22"), ws.Range("C22").End(xlDown).Offset(0, 6)).Copy
===
Regards,
Norman
This particular error can easily be resolved with a few simple steps. However, if you are not confident in your ability to use the methods below or they do not fully remove the issue on your computer, you may want to seek the assistance of a qualified repair technician who is well versed in fixing Copy cells from all sheets and paste into a single sheet.
- Back-up the Registry of your operating system.
- Find the Registry Key: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade]
- Note: this Registry Key should already exist, if it does not exist, create it.
- Create a brand new DWORD Value that is named AllowOsUpdate
- Set the Value to 0x00000001.
- Close and reopen your Control Panel.
- Restart the Microsoft Windows.
Another Safe way to Fix the Problem: Copy cells from all sheets and paste into a single sheet:
How to Fix Copy cells from all sheets and paste into a single sheet with SmartPCFixer?
1. You can Download SmartPCFixer here. Install it on your computer. When you open it, it will perform a scan.
2. After the scan is finished, you can see the errors and problems which need to be repaired.
3. The Fixing part is done, the speed of your computer will be much higher than before and the errors have been removed.
Related: How Can You Update & Download NVidia 6100, 6800 GS/XT Display Driver v.260.89 WHQL,Where to Download NVidia GeForce 8800 GT WHQL-certified driver v.196.21,How to Update & Download NVidia GeForce Go 7400 Display Driver v.260.19.12,[Solved] Download NVidia GeForce GTX 460M Driver v.331.82,Download NVidia Quadro Plex Model IV VGA Driver v.304.43 Certified,Way to Download RealTek RTL8100C(L) Driver v.5.01,Way to Download RealTek RTL8100E Drivers v.694,Way to Update & Download RealTek RTL8101L Auto Installation Program v.6.110 driver,Method to Update & Download RealTek RTL8111G PXE and RPL ROM code v.2.58 driver,How to Update & Download RealTek RTL8411B(N) Driver v.10.003,Best Way to Update & Download ASUS A53SV nVidia Graphics Driver v.8.17.12.6686,Method to Herunterladen ASUS K75VJ Intel Rapid Storage Technology Treiber v.11.6.0.1030,How Can You Update & Download ASUS CG8580 Intel Chipset Driver v.9.3.0.1019,Method to Update & Download ASUS K41VD Intel INF Update Driver v.9.1.1.1015,Way to Update & Download ASUS Pro70T NB Probe v.3.0.0026 driver
Read More: Troubleshoot:connection status is unknown,the service to detect this status is turned off. how can i fix this problem?,control panel is not working Tech Support,Tech Support: Copy Data from Various Spreadsheets,How to Resolve - Crash and reboot when creating a restore point or doing other system restore related things?,Troubleshoot:count formula automatcally,Closing Internet Explorer causes error,Compare 2 Tables and Calculate the PROFIT Faster,Computer goes to Windows Boot Manager after Start,Connect to one of my network computer remotely when don't allow exception box Marked,computer locking up randomly
No comments:
Post a Comment