Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Parse Data Sheet (anti-consolidate)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 19 Mar 2008 21:57 GMT
Hi everyone.  I have a data sheet that 14,000 rows long.  In column A
is the customer number.  Then I have a "control" sheet, where I have a
list of customer numbers to pull (copy) from the data sheet (A3:A20).
Can VBA scan the data sheet, create a new sheet for all entries in
Control("A3:A20"), and copy in the entire row for every instance found
in the data sheet for each customer identified in Control("A3:A20")?
Thanks!
Steve - 19 Mar 2008 22:53 GMT
Hi all.  I was able to find this code.  This takes the data sheet, and
based on the values of column a creates a sheet for each unique
instance and copies the data in.  Can this be modified to incorporate
the list of values to do this to?  Basically, The data sheet has over
300 customers in column A.  I dont want to create 300 sheets!  Only
about 20, that will be in the list in Control("A1:A20").  Thanks!!

Sub ParseData()

Application.ScreenUpdating = False

With Sheets("Data")
lr = .Cells(Rows.Count, "a").End(xlUp).Row
 .Range("A1:A" & lr).AdvancedFilter Action:=xlFilterInPlace,
Unique:=True
For Each c In .Range("a2:a" & lr).SpecialCells(xlVisible)
On Error Resume Next
If Worksheets(c.Value) Is Nothing Then
 Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = c
End If
 .ShowAllData
 .Range("a1:a" & lr).AutoFilter field:=1, Criteria1:=c
dlr = Sheets(c.Value).Cells(Rows.Count, "a").End(xlUp).Row + 1
 .Range("a2:a" & lr).Copy Sheets(c.Value).Range("a" & dlr)
Next c
 .ShowAllData
 .Range("a1:a" & lr).AutoFilter
End With

Application.ScreenUpdating = True
Sheets("Data").Select

End Sub

> Hi everyone.  I have a data sheet that 14,000 rows long.  In column A
> is the customer number.  Then I have a "control" sheet, where I have a
[quoted text clipped - 3 lines]
> in the data sheet for each customer identified in Control("A3:A20")?
> Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.