Copy Records From a Table Based on Values in Column
I'm struggling to find the right function that will allow me to copy all of the records from my table based on the values in the Code C column.
I want to create another table on Sheet 2 which displays all of the records, from this table on Sheet 1, where Code C is 'PNP' for example.
Then I can use the solution to create tables on new worksheets that extract all of the records for the other Code C values.
Solutions to the Problem Copy Records From a Table Based on Values in Column
ALT+F11 to open VB editor, right click 'ThisWorkbook' and insert module and paste the code below in.
Change the src (Source) and dst (destination) sheet names to the correct ones and run it
Dim MyRange, CopyRange As Range
Dim LastRow As Long
Set src = Sheets("Sheet1") 'change to suit
Set dst = Sheets("Sheet2") ' change to suit
LastRow = src.Cells(Cells.Rows.Count, "E").End(xlUp).Row
Set MyRange = src.Range("E2:E" & LastRow)
For Each c In MyRange
If UCase(c.Value) = "PNP" Then
If CopyRange Is Nothing Then
Set CopyRange = c.EntireRow
Set CopyRange = Union(CopyRange, c.EntireRow)
If Not CopyRange Is Nothing Then
If this post answers your question, please mark it as the Answer.
System Update Readiness Command: To Fix Copy Records From a Table Based on Values in Column
On running the System Update readiness Command, it will Detect & Replace Incorrect Registry data with the Correct one. Which may ultimately Solve Copy Records From a Table Based on Values in Column in Windows.
- Open CMD as Administrator by Simply Right Clicking on Start button > Command Prompt (Admin).
- Now Type or Copy paste "DISM.exe /Online /Cleanup-image /Scanhealth" and hit Enter,
- Now again Type or Copy paste this "DISM.exe /Online /Cleanup-image /Restorehealth" and hit Enter.
- Close the Command Prompt Window because we are done.
Reboot your Windows & see if error Copy Records From a Table Based on Values in Column is still there.
Note: Your administrator's password might be needed.
Recommended Method to Fix the Problem: Copy Records From a Table Based on Values in Column:
How to Fix Copy Records From a Table Based on Values in Column with SmartPCFixer?
1. Click the button to download Error Fixer . Install it on your system. Run it, and it will scan your computer. The junk files will be shown in the scan result.
2. After the scan is finished, you can see the errors and problems need to be fixed. Click Fix All.
3. When the Fixing part is finished, your computer has been speeded up 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.18.104.22.16886,Method to Herunterladen ASUS K75VJ Intel Rapid Storage Technology Treiber v.22.214.171.1240,How Can You Update & Download ASUS CG8580 Intel Chipset Driver v.126.96.36.1999,Method to Update & Download ASUS K41VD Intel INF Update Driver v.188.8.131.525,Way to Update & Download ASUS Pro70T NB Probe v.3.0.0026 driver
Read More: Troubleshoot:converting all earlier works files to ms office 2003 files,Troubleshooting:convert equation from equation editor to microsoft 2007,Troubleshoot:Converting decimals to time Error,Tech Support: Count Unique Values from Filtered Data,Troubleshooting:Creating more than one Index in Word 2010,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