Wednesday, July 6, 2016

Solution to Error: Another macro to extract data from multiple sheets question

Another macro to extract data from multiple sheets question

Hello.
Read through many of the helpful answers on macros/VBAs ...
but as I've never done a macro/VBA, hopefully someone can help.

I have 5 sheets in a workbook and need to extract data from all of them into 3 new sheets.
Each sheet has data in Columns A-P, and the functions are the same in each sheet.
The extraction/filter criteria would be based on what's in Column F in each sheet (TR,
TE or ST) - all the TRs would be in one sheet, TEs in one sheet, etc.
But I would also like the corresponding data in Columns A, N, O & P to be extracted too.
If this isn't possible, then can the entire corresponding row be extracted into the new sheet?

Thanks!

Keys to the Problem Another macro to extract data from multiple sheets question

Download Error Fixer for Free Now

Hi,
try this...
(make a copy before you run this code..)
 
Sub Autofilter_SplitData()
On Error Resume Next
Const myCol As String = "F"   '<<< use autofilter in column
Dim r As Long, i As Long, j As Long, t As Long
Dim vCrit As Variant, vSh As Variant
vSh = Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5") '<<< change shts names
vCrit = Array("TR", "TE", "ST") '<<< change criteria
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each sh In Sheets
For i = 0 To UBound(vCrit)
If sh.Name = vCrit(i) Then sh.Delete
Next
Next
Application.DisplayAlerts = True
For i = 0 To UBound(vCrit)
Sheets.Add
ActiveSheet.Name = vCrit(i)
Sheets(vSh(0)).Range("A1:P1").Copy Range("A1") '<<< headers in columns A-P
t = 2
For j = 0 To UBound(vSh)
Sheets(vSh(j)).AutoFilterMode = False
r = Sheets(vSh(j)).Cells(Rows.Count, myCol).End(xlUp).Row
Sheets(vSh(j)).Range(myCol & "1:" & myCol & r).AutoFilter Field:=1, Criteria1:=vCrit(i)
Sheets(vSh(j)).Rows("2:" & r).Copy
Cells(t, 1).PasteSpecial xlValues
t = Cells(Rows.Count, myCol).End(xlUp).Row + 1
Sheets(vSh(j)).AutoFilterMode = False
Next
Range("B:M").Delete Shift:=xlToLeft '<<< delete columns B-M
ActiveSheet.UsedRange.EntireColumn.AutoFit
Range("A1").Select
Next
Application.ScreenUpdating = True
End Sub

Check Windows System Requirements

This error can be due to some configuration requirements for you system. If your computer hardware is not up to par, then make sure you upgrade where necessary before continuing:

Microsoft Windows Requirements :

  • 1 gigahertz (GHz) or faster 32-bit (x86) or 64-bit (x64) processor
  • 16 GB available hard disk space (32-bit) or 20 GB (64-bit)

Recommended Method to Fix the Problem: Another macro to extract data from multiple sheets question:

How to Fix Another macro to extract data from multiple sheets question with SmartPCFixer?

1. You can Download Error Fixer here. Install it on your system. When you open it, it will perform a scan.

2. After the scan is done, you can see the errors and problems need to be fixed. Click Fix All.

3. The Repair part is done, the speed of your computer will be much higher than before and the errors have been fixed. You can also use other functions in this software. Like dll downloading, windows updating and print spooler error repair.


Related: error message fsui.exe/ wlidcli.dll is missing
,Solution to Error: Excel: Automatic number generation
,Troubleshoot:i wanna change language of all windows in Windows 7 Home Premium
,Troubleshooting:IF Function, if the vendor ID in column A matches any of the vendor ID's in column F, I want 1099 to appear in column D. Error
,Fast Solution to Problem: ReadyBoost is not working properly in my computer
,Troubleshoot:Error: "0x81000032 make sure the C: drive is online and set to NTFS" when trying to backup to external hard drive. Error,External Hard Drive not listed in Windows 7 backup wizard Tech Support,Tech Support: I'm always being signed off so annoying,Solution to Problem: Impossible to use Internet Explorer! I keep getting the same error message every time i try to use IE.,Referencing data in Access using Excel [Anwsered],Need Best Way To Present Data [Anwsered],Same question but for windows 7 home edition,sometimes fullscreen won't activate [Solved],Solution to Error: We bought a new computer with windows 7 and it is constantly freezing. How do we fix this?,Solution to Error: Windows 8 update crash (2013-07-22),brclr.dll.mu_ Missing Error Fixer,How To Resolve Missing fin_myagtui.eng Problem,Corrupted f_0006ad File - How to Fix,nkebigvg.cpl Not Found Error Fixer,Corrupted olcontrols.ocx File - How to Fix
Read More: An unhandled exception - Error 0x1A88 [Solved],Alpha\/Numeric formula,How to Resolve - All the Chromium-based are not working...?,Troubleshooting:all the microsoft programs are turned off,[Solution] appcrash explorer.exe 6.0.6001.18164,After Windows Update CD/DVD drive does not work,After installing windows 7 to laptop the labels print out of line how can I fix it,After my computer sleeps the wireless always disconnects and will no reconnect,After signing into Pogo.com, I get a message" This tab has been recovered"....what does this mean and how do I fix it.....,All desktop icons changed to windows live and does not open

No comments:

Post a Comment