Split into sheets based on multiple criteria

cdrobinson83

New Member
Joined
May 3, 2021
Messages
34
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm in need of a macro that splits data in one sheet across multiple new sheets based on variables. For example, I would like to take the information below and split it into separate sheets, including all the existing columns, based on Name and Location. Is someone able to assist with this?

NameColorSizeLocationQuantity
JimRedLargeForeign3
SteveBlueMediumDomestic8
BobGreenSmallForeign4
JimBlueMediumDomestic4
SteveGreenSmallForeign7
BobRedMediumDomestic5
JimGreenSmallForeign5
SteveRedLargeDomestic6
BobBlueLargeForeign6
JimRedLargeDomestic6
SteveBlueMediumForeign5
BobGreenSmallDomestic7
JimBlueMediumForeign7
SteveGreenSmallDomestic4
BobRedMediumForeign8
JimGreenSmallDomestic8
SteveRedLargeForeign3
BobBlueLargeDomestic9
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I'm going to assume that:
1. The data is on Sheet1, adjust the name in the macro.
2. Names start in cell A2.​
3. Headers are in row 1​
4. The headers should be copied to the new sheet.​
5. The name of the new sheet will be composed of the Name - Location.​
6. The sheet name must not exceed 31 characters, which is the maximum allowed for a sheet name.​

If the above is correct, try:
VBA Code:
Sub create_worksheets()
  Dim sh As Worksheet
  Dim c As Range, ky As Variant, itm As Variant
  Dim dic As Object
  
  Application.ScreenUpdating = False
  
  Set sh = Sheets("Sheet1")     'fit name of your sheet
  
  Set dic = CreateObject("Scripting.Dictionary")
  
  For Each c In sh.Range("A2", sh.Range("A" & Rows.Count).End(3))
    ky = c.Value & "-" & c.Offset(0, 3).Value
    dic(ky) = Empty
  Next c
  
  For Each itm In dic.Keys
    sh.Range("A1").AutoFilter 1, Split(itm, "-")(0)
    sh.Range("A1").AutoFilter 4, Split(itm, "-")(1)
    On Error Resume Next: Sheets(itm).Delete: On Error GoTo 0
    Sheets.Add(, Sheets(Sheets.Count)).Name = Left(itm, 31)
    sh.AutoFilter.Range.EntireRow.Copy Range("A1")
    sh.ShowAllData
  Next
  sh.Select
  
  Application.ScreenUpdating = False
End Sub

In the future try to be more precise in your request, that way you will have more opportunity for help.
🧙‍♂️
 
Upvote 0
Solution
I'm going to assume that:
1. The data is on Sheet1, adjust the name in the macro.​
2. Names start in cell A2.​
3. Headers are in row 1​
4. The headers should be copied to the new sheet.​
5. The name of the new sheet will be composed of the Name - Location.​
6. The sheet name must not exceed 31 characters, which is the maximum allowed for a sheet name.​

If the above is correct, try:
VBA Code:
Sub create_worksheets()
  Dim sh As Worksheet
  Dim c As Range, ky As Variant, itm As Variant
  Dim dic As Object
 
  Application.ScreenUpdating = False
 
  Set sh = Sheets("Sheet1")     'fit name of your sheet
 
  Set dic = CreateObject("Scripting.Dictionary")
 
  For Each c In sh.Range("A2", sh.Range("A" & Rows.Count).End(3))
    ky = c.Value & "-" & c.Offset(0, 3).Value
    dic(ky) = Empty
  Next c
 
  For Each itm In dic.Keys
    sh.Range("A1").AutoFilter 1, Split(itm, "-")(0)
    sh.Range("A1").AutoFilter 4, Split(itm, "-")(1)
    On Error Resume Next: Sheets(itm).Delete: On Error GoTo 0
    Sheets.Add(, Sheets(Sheets.Count)).Name = Left(itm, 31)
    sh.AutoFilter.Range.EntireRow.Copy Range("A1")
    sh.ShowAllData
  Next
  sh.Select
 
  Application.ScreenUpdating = False
End Sub

In the future try to be more precise in your request, that way you will have more opportunity for help.
🧙‍♂️

Thank you VERY much for this. And I will be sure to be clearer in the future. If I wanted to add a 3rd filter, is that simple to do? And if I needed to compensate for the filtered columns being in different locations, how would I do that? I'm basically trying to fit this to other files I may need to split as well; for example, 39 columns instead of only 5. Is it possible to cater this macro to fit?
 
Upvote 0
Also, will this always find the full range if there are any blank cells? Because that may be the case at times. Like the below just as an example.

BUS DATEEXCHANGEINVOICE NUMBERBUY/SELLCMFTMFORIGINACCOUNT #OPPOSITE CMFOPPOSITE TMFOPPOSITE ORIGINCONTRACTPERIODCVFPRICECONTRACT VALUECCYINTENT DATEDELIVERY DATEFACILITY NAMEFACILITY NUMBERCERTIFICATE NUMBERGRADEFORMBRAND(S)NUMBER OF BARSNUMBER OF BUNDLESNUMBER OF PIECESNET WEIGHTFINE WEIGHTMETRIC TONSSTORAGE TYPESTORAGE DAYSSTORAGE RATESTORAGE PAID THRU DATEFUTURES COSTHANDLING OUT CHARGESTORAGE CHARGETOTAL AMOUNT
11/1/2024COMEX1273829568BUYERZZZZZZCUSTABCDEZZZZZZCUSTGC2024111002738.3273830USD10/31/202411/4/2024 20016709251055 ARHE/ARHE/ARHE3 96.45395.97 260.511/30/2024-262794.65 -13-262807.65
11/1/2024COMEX1273829568BUYERZZZZZZCUSTABCDEZZZZZZCUSTGC2024111002738.3273830USD10/31/202411/4/2024 20016709251056 ARHE/ARHE/ARHE3 96.45395.97 260.511/30/2024-262794.65 -13-262807.65
11/1/2024COMEX1273829568BUYERZZZZZZCUSTABCDEZZZZZZCUSTGC2024111002738.3273830USD10/31/202411/4/2024 20016709251057 ARHE/ARHE/ARHE3 96.45395.97 260.511/30/2024-262794.65 -13-262807.65
11/1/2024COMEX1273829568BUYERZZZZZZCUSTABCDEZZZZZZCUSTGC2024111002738.3273830USD10/31/202411/4/2024 20016709251058 ARHE/ARHE/ARHE3 96.45395.97 260.511/30/2024-262794.65 -13-262807.65
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00023431FULL_PLATEZALD/ZALD/ZALD/ZALD/ZALD 1/2/3/4/5 60/56/64/50/3024970 260.511/30/2024-107708.1-625-162.31-108495.41
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00023911FULL_PLATEZALD/ZALD/ZALD/ZALD/ZALD 1/2/3/4/5 56/62/61/59/3024981 260.511/30/2024-107755.54-625-162.38-108542.92
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00027891FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 52/51/48/44/2425339 260.511/30/2024-109299.78-625-164.71-110089.49
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00028261FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 53/54/56/50/2425347 260.511/30/2024-109334.28-625-164.76-110124.04
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00031311FULL_PLATERT/RT/RT/RT/RT 1/2/3/4/5 60/60/60/60/3324942 260.511/30/2024-107587.32-625-162.12-108374.44
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00031461FULL_PLATERT/RT/RT/RT/RT 1/2/3/4/5 60/60/60/60/3024910 260.511/30/2024-107449.29-625-161.92-108236.21
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00031551FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 48/46/43/56/2424949 260.511/30/2024-107617.51-625-162.18-108404.69
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00031621FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 45/44/50/40/2424916 260.511/30/2024-107475.17-625-161.95-108262.12
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00032091FULL_PLATEGABY/GABY/GABY/GABY/GABY 1/2/3/4/5 63/66/69/67/3424505 260.511/30/2024-105702.32-625-159.29-106486.61
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00038301FULL_PLATEESOX/ESOX/ESOX/ESOX/ESOX 1/2/3/4/5 33/33/31/34/1824848 260.511/30/2024-107181.85-625-161.51-107968.36
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00038651FULL_PLATEESOX/ESOX/ESOX/ESOX/ESOX 1/2/3/4/5 33/32/31/30/1824892 260.511/30/2024-107371.64-625-161.8-108158.44
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00038741FULL_PLATEESOX/ESOX/ESOX/ESOX/ESOX 1/2/3/4/5 31/32/32/32/1825184 260.511/30/2024-108631.18-625-163.7-109419.88
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00038881FULL_PLATEABRA/ABRA/ABRA/ABRA/ABRA 1/2/3/4/5 35/35/35/35/1524847 260.511/30/2024-107177.53-625-161.51-107964.04
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00040421FULL_PLATEPDGO/PDGO/PDGO/PDGO/PDGO 1/2/3/4/5 55/45/55/55/2025273 260.511/30/2024-109015.09-625-164.28-109804.37
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00042431FULL_PLATEMELT/MELT/MELT/MELT/MELT 1/2/3/4/5 64/60/56/62/5424910 260.511/30/2024-107449.29-625-161.92-108236.21
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00045331FULL_PLATEZALD/ZALD/ZALD/ZALD/ZALD 1/2/3/4/5 61/61/70/64/3024956 260.511/30/2024-107647.71-625-162.21-108434.92
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00046531FULL_PLATEMELT/MELT/MELT/MELT/MELT 1/2/3/4/5 60/60/56/54/5924993 260.511/30/2024-107807.31-625-162.46-108594.77
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09924901FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 50/49/48/48/2425082 260.511/30/2024-108191.21-625-163.03-108979.24
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925031FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 50/46/48/44/2425073 260.511/30/2024-108152.39-625-162.98-108940.37
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925081FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 40/46/46/46/2424999 260.511/30/2024-107833.19-625-162.5-108620.69
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925221FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 51/49/48/52/2425058 260.511/30/2024-108087.68-625-162.88-108875.56
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925801FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 31/40/38/50/2425108 260.511/30/2024-108303.36-625-163.2-109091.56
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925821FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 50/46/49/47/2425024 260.511/30/2024-107941.02-625-162.66-108728.68
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926251FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 54/54/47/48/2424904 260.511/30/2024-107423.4-625-161.88-108210.28
11/1/2024COMEX1273829135BUYERZZZZZZCUST12345ZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926331FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 38/58/42/48/2425026 260.511/30/2024-107949.65-625-162.67-108737.32
11/1/2024COMEX1273829135BUYERZZZZZZCUSTXYZZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926481FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 50/47/46/46/2425026 260.511/30/2024-107949.65-625-162.67-108737.32
11/1/2024COMEX1273829135BUYERZZZZZZCUSTXYZZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926491FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 48/37/50/50/2425093 260.511/30/2024-108238.66-625-163.11-109026.77
11/1/2024COMEX1273829135BUYERZZZZZZCUSTZZZZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926521FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 42/37/50/47/2424995 260.511/30/2024-107815.93-625-162.47-108603.4
11/1/2024COMEX1273829135BUYERZZZZZZCUSTFFFZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926651FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 50/48/44/50/2425049 260.511/30/2024-108048.86-625-162.83-108836.69
11/1/2024COMEX1273829136SELLERZZZZZZCUSTCCCZZZZZZHOUSHG202411250004.3135107837.5USD10/31/202411/4/2024 2503125620421FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 33/42/37/40/1825444 260.511/30/2024109752.69625165.39110543.08
11/1/2024COMEX1273829132SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 2503125620441FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 49/46/38/49/2124922 260.511/30/2024107501.05625161.99108288.04
11/1/2024COMEX1273829132SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 2503125620461FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 44/37/48/40/2225204 260.511/30/2024108717.45625163.83109506.28
11/1/2024COMEX1273829132SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 2503125620471FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 50/44/43/36/1725198 260.511/30/2024108691.57625163.79109480.36
11/1/2024COMEX1273829131SELLERZZZZZZCUSTCCCZZZZZZHOUSHG202411250004.3135107837.5USD10/31/202411/4/2024 2503125620641FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 34/44/40/49/2124608 260.511/30/2024106146.61625159.95106931.56
11/1/2024COMEX1273829131SELLERZZZZZZCUSTCCCZZZZZZHOUSHG202411250004.3135107837.5USD10/31/202411/4/2024 2503125620651FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 48/49/39/49/2225252 260.511/30/2024108924.5625164.14109713.64
11/1/2024COMEX1273829131SELLERZZZZZZCUSTCCCZZZZZZHOUSHG202411250004.3135107837.5USD10/31/202411/4/2024 2503125620661FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 40/36/43/34/2025346 260.511/30/2024109329.97625164.75110119.72
11/1/2024COMEX1273829131SELLERZZZZZZCUSTCCCZZZZZZHOUSHG202411250004.3135107837.5USD10/31/202411/4/2024 2503125620671FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 42/32/40/34/2525460 260.511/30/2024109821.71625165.49110612.2
11/1/2024COMEX1273829131SELLERZZZZZZCUSTCCCZZZZZZHOUSHG202411250004.3135107837.5USD10/31/202411/4/2024 2503125620681FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 46/36/40/30/2224962 260.511/30/2024107673.59625162.25108460.84
11/1/2024COMEX1273829131SELLERZZZZZZCUSTCCCZZZZZZHOUSHG202411250004.3135107837.5USD10/31/202411/4/2024 2503125620881FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 36/51/41/41/2224682 260.511/30/2024106465.81625160.43107251.24
11/1/2024COMEX1273829132SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 2503125850551FULL_PLATERT/RT/RT/RT/RT 1/2/3/4/5 60/60/60/60/3024814 260.511/30/2024107035.19625161.29107821.48
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00023431FULL_PLATEZALD/ZALD/ZALD/ZALD/ZALD 1/2/3/4/5 60/56/64/50/3024970 260.511/30/2024107708.1625162.31108495.41
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00023591FULL_PLATEZALD/ZALD/ZALD/ZALD/ZALD 1/2/3/4/5 64/61/65/61/3024935 260.511/30/2024107557.12625162.08108344.2
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00023911FULL_PLATEZALD/ZALD/ZALD/ZALD/ZALD 1/2/3/4/5 56/62/61/59/3024981 260.511/30/2024107755.54625162.38108542.92
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00024131FULL_PLATEZALD/ZALD/ZALD/ZALD/ZALD 1/2/3/4/5 66/62/60/66/3024982 260.511/30/2024107759.86625162.38108547.24
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00027891FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 52/51/48/44/2425339 260.511/30/2024109299.78625164.71110089.49
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00028151FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 55/44/43/44/2425322 260.511/30/2024109226.45625164.59110016.04
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00028261FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 53/54/56/50/2425347 260.511/30/2024109334.28625164.76110124.04
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00028321FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 51/50/50/46/2425349 260.511/30/2024109342.91625164.78110132.69
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00031311FULL_PLATERT/RT/RT/RT/RT 1/2/3/4/5 60/60/60/60/3324942 260.511/30/2024107587.32625162.12108374.44
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00031361FULL_PLATERT/RT/RT/RT/RT 1/2/3/4/5 60/60/60/60/3025031 260.511/30/2024107971.22625162.71108758.93
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00031461FULL_PLATERT/RT/RT/RT/RT 1/2/3/4/5 60/60/60/60/3024910 260.511/30/2024107449.29625161.92108236.21
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00031511FULL_PLATERT/RT/RT/RT/RT 1/2/3/4/5 60/60/60/60/2025066 260.511/30/2024108122.19625162.93108910.12
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00031551FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 48/46/43/56/2424949 260.511/30/2024107617.51625162.18108404.69
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00031571FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 46/42/49/46/2424992 260.511/30/2024107802.99625162.45108590.44
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00031621FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 45/44/50/40/2424916 260.511/30/2024107475.17625161.95108262.12
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00031881FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 46/40/46/40/2424872 260.511/30/2024107285.37625161.67108072.04
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00032091FULL_PLATEGABY/GABY/GABY/GABY/GABY 1/2/3/4/5 63/66/69/67/3424505 260.511/30/2024105702.32625159.29106486.61
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00035141FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 46/41/40/46/1524524 260.511/30/2024105784.27625159.41106568.68
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00038301FULL_PLATEESOX/ESOX/ESOX/ESOX/ESOX 1/2/3/4/5 33/33/31/34/1824848 260.511/30/2024107181.85625161.51107968.36
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00038481FULL_PLATEESOX/ESOX/ESOX/ESOX/ESOX 1/2/3/4/5 29/31/30/29/1824841 260.511/30/2024107151.65625161.47107938.12
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00038651FULL_PLATEESOX/ESOX/ESOX/ESOX/ESOX 1/2/3/4/5 33/32/31/30/1824892 260.511/30/2024107371.64625161.8108158.44
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00038701FULL_PLATEESOX/ESOX/ESOX/ESOX/ESOX 1/2/3/4/5 33/30/32/33/1824888 260.511/30/2024107354.39625161.77108141.16
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00038741FULL_PLATEESOX/ESOX/ESOX/ESOX/ESOX 1/2/3/4/5 31/32/32/32/1825184 260.511/30/2024108631.18625163.7109419.88
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00038811FULL_PLATEABRA/ABRA/ABRA/ABRA/ABRA 1/2/3/4/5 35/35/35/35/1524831 260.511/30/2024107108.52625161.41107894.93
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00038881FULL_PLATEABRA/ABRA/ABRA/ABRA/ABRA 1/2/3/4/5 35/35/35/35/1524847 260.511/30/2024107177.53625161.51107964.04
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00039281FULL_PLATEZALD/ZALD/ZALD/ZALD/ZALD 1/2/3/4/5 58/65/59/64/2525075 260.511/30/2024108161.01625162.99108949
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00040421FULL_PLATEPDGO/PDGO/PDGO/PDGO/PDGO 1/2/3/4/5 55/45/55/55/2025273 260.511/30/2024109015.09625164.28109804.37
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00040451FULL_PLATEGABY/GABY/GABY/GABY/GABY 1/2/3/4/5 44/60/60/67/4024859 260.511/30/2024107229.3625161.59108015.89
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00042431FULL_PLATEMELT/MELT/MELT/MELT/MELT 1/2/3/4/5 64/60/56/62/5424910 260.511/30/2024107449.29625161.92108236.21
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00042561FULL_PLATEMELT/MELT/MELT/MELT/MELT 1/2/3/4/5 64/66/65/61/4525035 260.511/30/2024107988.47625162.73108776.2
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00045331FULL_PLATEZALD/ZALD/ZALD/ZALD/ZALD 1/2/3/4/5 61/61/70/64/3024956 260.511/30/2024107647.71625162.21108434.92
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00046321FULL_PLATEMELT/MELT/MELT/MELT/MELT 1/2/3/4/5 63/53/52/63/5024699 260.511/30/2024106539.14625160.55107324.69
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO00046531FULL_PLATEMELT/MELT/MELT/MELT/MELT 1/2/3/4/5 60/60/56/54/5924993 260.511/30/2024107807.31625162.46108594.77
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09924821FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 40/40/41/47/2424971 260.511/30/2024107712.41625162.32108499.73
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09924901FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 50/49/48/48/2425082 260.511/30/2024108191.21625163.03108979.24
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925011FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 50/49/45/48/2425024 260.511/30/2024107941.02625162.66108728.68
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925031FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 50/46/48/44/2425073 260.511/30/2024108152.39625162.98108940.37
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925061FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 44/48/46/48/2425027 260.511/30/2024107953.96625162.68108741.64
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925081FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 40/46/46/46/2424999 260.511/30/2024107833.19625162.5108620.69
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925111FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 40/40/51/46/2425069 260.511/30/2024108135.13625162.96108923.09
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925221FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 51/49/48/52/2425058 260.511/30/2024108087.68625162.88108875.56
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925741FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 30/43/46/41/2425065 260.511/30/2024108117.88625162.93108905.81
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925801FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 31/40/38/50/2425108 260.511/30/2024108303.36625163.2109091.56
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09925821FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 50/46/49/47/2425024 260.511/30/2024107941.02625162.66108728.68
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926251FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 54/54/47/48/2424904 260.511/30/2024107423.4625161.88108210.28
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926331FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 38/58/42/48/2425026 260.511/30/2024107949.65625162.67108737.32
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926481FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 50/47/46/46/2425026 260.511/30/2024107949.65625162.67108737.32
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926491FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 48/37/50/50/2425093 260.511/30/2024108238.66625163.11109026.77
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926521FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 42/37/50/47/2424995 260.511/30/2024107815.93625162.47108603.4
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926551FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 47/50/46/41/2425067 260.511/30/2024108126.5625162.94108914.44
11/1/2024COMEX1273829134SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926561FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 46/43/45/48/2425062 260.511/30/2024108104.94625162.9108892.84
11/1/2024COMEX1273829135SELLERZZZZZZCUSTCCCZZZZZZCUSTHG202411250004.3135107837.5USD10/31/202411/4/2024 4313CNO09926651FULL_PLATESPEN/SPEN/SPEN/SPEN/SPEN 1/2/3/4/5 50/48/44/50/2425049 260.511/30/2024108048.86625162.83108836.69
11/1/2024COMEX1273829119SELLERZZZZZZCUSTCCCZZZZZZHOUSHG202411250004.3135107837.5USD10/31/202411/4/2024 593148531FULL_PLATECSBL/CSBL/CSBL/CSBL/CSBL 1/2/3/4/5 55/55/55/55/5525176 260.466511/30/2024108596.68600152.69109349.37
11/1/2024COMEX1273829119SELLERZZZZZZCUSTCCCZZZZZZHOUSHG202411250004.3135107837.5USD10/31/202411/4/2024 593148541FULL_PLATECSBL/CSBL/CSBL/CSBL/CSBL 1/2/3/4/5 55/55/55/55/5525492 260.466511/30/2024109959.74600154.61110714.35
 
Upvote 0
I tried to edit to add that I'd like to create worksheets based on "BUY/SELL" , "ACCOUNT #" and "CONTRACT" , sorry. I waited too long to edit so had to reply instead.
 
Upvote 0
If I wanted to add a 3rd filter, is that simple to do? And if I needed to compensate for the filtered columns being in different locations, how would I do that? I'm basically trying to fit this to other files I may need to split as well; for example, 39 columns instead of only 5. Is it possible to cater this macro to fit?
As I said, you must be very specific in what you need.

Comment if post #2 worked for what you asked for in your original post.

For everything else you need, create a new thread and there explain in detail what you have and what you expect as a result.
 
Upvote 0
As I said, you must be very specific in what you need.

Comment if post #2 worked for what you asked for in your original post.

For everything else you need, create a new thread and there explain in detail what you have and what you expect as a result.
Marked as solved and opening a new thread now. My apologies.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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