[vba] Organizing Data With Dates

DataBlake

Well-known Member
Joined
Jan 26, 2015
Messages
781
Office Version
  1. 2016
Platform
  1. Windows
I get a report that looks like this

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAY
1Sales Record NumberUser IdBuyer FullnameBuyer Phone NumberBuyer EmailBuyer Address 1Buyer Address 2Buyer CityBuyer StateBuyer ZipBuyer CountryOrder IDItem IDTransaction IDItem TitleQuantitySale PriceShipping And HandlingSales TaxInsuranceeBay Collected TaxTotal PriceTotal Includes eBay Collected TaxPayment MethodPayPal Transaction IDSale DateCheckout DatePaid on DateShipped on DateShipping ServiceFeedback LeftFeedback ReceivedNotes to YourselfCustom LabelListed OnSold OnPrivate NotesProduct ID TypeProduct ID ValueProduct ID Value 2Variation DetailsProduct Reference IDTracking NumberGlobal Shipping Reference IDShip To Address 1Ship To Address 2Ship To CityShip To StateShip To ZipShip To CountryPhone
210520bobbert123Bobbert Boberson(123) 456-7890reeeeeeeeee@gmail.com123 Bobbert LnCityNY34978-1018United States1111111111111111111111112 Boxes of Spaghettios13000199003003300TruePayPalA5F7R5FD6V3CX4S7F9Sep-21-19Sep-21-19Sep-21-19Sep-24-19Economy ShippingNo8004eBayeBayhi…1111111444444123 Bobbert LnCityNY34978-1018United States(123) 456-7890
310521juniper1June Ooga Booga(321) 654-0987hamburgerhelper@aol.net1 E Circle StAPT 1New York CityAZ1234567United States1212121212121212121212121 Whole Live Cat15199000204FalsePayPal8FA4S5D6F9S8A7S5Sep-21-19Sep-21-19Sep-21-19Sep-23-19Economy ShippingNoL5654887eBayeBay1615161516151 E Circle StNew York CityAZ1234567United States(321) 654-0987
410522loiuse371Luis Misspell(213) 465-8097cooties@gmail.com42124251523432123432123 DrHellFL34990United States123123123123123123123123An Empty Box with 16 air1400000000004000000FalsePayPalASDF56748GDSAS65487FSep-23-19Sep-24-19Sep-24-19Sep-25-19UPS GroundYesPositiveASDF-14224SeBayeBay181518151815142124251523432123432123 DrHellFL34990United States(213) 465-8097
Import


and i need to import relevant data to this format

Book1
ABCDEFGHIJKL
1ORDERS - September 21 2019
2
3NAMEITEM #PO NUMBERQTYThing1Thing1 DescriptionThing2Thing2 DescriptionKitTPMSSTATUSNOTES
4Bobbert Boberson111111111111st26Boberson280042 Boxes of SpaghettiosComplete
5June Ooga Booga121212121212st26Booga1L56548871 Whole Live CatComplete
6
7ORDERS - September 23 2019
8
9NAMEITEM #PO NUMBERQTYThing1Thing1 DescriptionThing2Thing2 DescriptionKitTPMSSTATUSNOTES
10Luis Misspell123123123123St26Misspell16ASDF-14224SAn Empty Box with 16 airComplete
CustomerDATA


what i'm concerned with right now is the grouping data by date part. Everything else i can do and you don't need to worry about it.
basically the logic is to find unique values in column 26 of the "Import" Sheet (Sale Date) and separate the rows by the dates so that i can import/format the values
I was thinking a sort by date, count unique values and store that in a long variable, then loop through column 26 of the "Import" sheet until the value changes from the previous value and subtract 1 from the long, adding two rows to the "CustomerDATA" sheet.

but....i'm certain theres a better way
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
is there a way to use Index with unique values in VBA?
if i can just index the first unique value in column 26 that would probably make life easier
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,271
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top