bit of a curly one!

hepkat63

New Member
Joined
Aug 23, 2022
Messages
20
Office Version
  1. 365
Platform
  1. Windows
Hi all,
I have a bit of a curly problem that I'm hoping someone can help me work though!
Every day, I am required to manipulate a couple of existing spreadsheets in able to consolidate data in to a certain format as so I can then copy/paste that information into SAP.
I can do this with lots of manual steps, however of course would like to automate it, but the variables have made it a confusing problem.
I have one spreadsheet called 'issues. This contains multiple columns which are populated as goods are issued from our store.
I have another spreadsheet that is created daily by downloading information from SAP. The name of this spreadsheet changes everyday with the download based on date.
First problem: How to isolate the required five columns and varying amount of rows of data from the 'issues' sheet that are between yesterdays date and todays date AND from the 2nd last row that has been highlighted in Yellow colour to the last row that is highlighted in the Yellow color (I highlight the row at the end of the shift to differentiate between shifts). Then select and copy this data to another spreadsheet
Second problem: In the downloaded spreadsheet from SAP, go to the first empty row (as each day the amount of data varies), then go to column number four and paste the data from Problem 1 (issues sheet)
Hoping someone can help!
 
Hi,

Can you provide us the data of the 2nd spreadsheet as XLBB?

Are those actual worksheet names? Those worksheets are in the same workbook?

VBA Code:
Set shDLSAP = Sheets("GoodsIssuedToSap_20220829_131456.xlsx") 'Change here to suit actual sheet name
Set shIssues = Sheets("store tally report - MASTER.xlsm") 'Change here to suit actual sheet name
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Here is the Issues sheet:

Book5
ABCDEFGHIJKLMNOP
1SAPQty BLANKSLOCDepartmentIssuerDATEDescriptionLaundry IDName Blank2Supervisor SlipReplaced/NewTimeblank3Storage Location
2500-2200921SL1111901234LPRIOR26 Aug 2022SLEEVE 50CM CUT-RESISTANT GREY CUFF 93.79Jev Bajalia BarabadNONEW12:14:44DRY STORE
3500-2210782SL1110201234NSUKWIPAD26 Aug 2022GLOVE POLAR BEAR RED SZ 755Shengzhen JiaoNONEW12:59:09DRY STORE
4500-2029711SL1110201234MARK26 Aug 2022STEEL **** COMBI 7-3882-25-66379Brodie McGillivrayNONEW13:38:22KNIFE ST8
5500-3587131SL1110201234MARK26 Aug 2022GLOVE SILVERLINED 88-350 SZ7999Gloves for LaundryNONEW13:48:54DRY STORE
6500-3587152SL1110201234MARK26 Aug 2022GLOVE SILVERLINED 88-350 SZ8999Gloves for LaundryNONEW13:50:14DRY STORE
7500-2210801SL1111901234MARK26 Aug 2022GLOVE POLAR BEAR DARK BLUE SZ 9238Theresa GalosalaYESNEW14:37:12DRY STORE
8500-2698921SL1111901234MARK26 Aug 2022BOOT PU GREEN BEKINA STEPLITEX SZ 9392Erwin EncarnacionYESREPLACED14:45:09GUMBOOTS
9500-2075071SL1111901234MARK26 Aug 2022GLASSES SAFETY ANTI FOG CLEAR MEVX2C18Chass MarshallYESNEW14:55:29DRY STORE
10500-2072271SL1113961234MARK26 Aug 2022GLOVES FREEZER FUR LINED472Ismail Bin AdamsYESREPLACED14:56:22DRY STORE
11500-2210802SL1111901234MARK26 Aug 2022GLOVE POLAR BEAR DARK BLUE SZ 9428Maikeli WaituiYESNEW15:10:50DRY STORE
12500-2210812SL1111901234NSUKWIPAD26 Aug 2022GLOVE POLAR BEAR BLACK SZ 10403Christopher TobinYESNEW15:27:06DRY STORE
13500-2188121SL1111901234NSUKWIPAD26 Aug 2022EARMUFFS PELTOR H7P3E CLIP-ON150Mathew LeahyYESNEW16:49:55DRY STORE
14500-2075071SL1111901234NSUKWIPAD26 Aug 2022GLASSES SAFETY ANTI FOG CLEAR MEVX2C423Moo NayYESNEW17:04:40DRY STORE
15500-3587135SL1120721234CBIRTHIS29 Aug 2022GLOVE SILVERLINED 88-350 SZ7999Gloves for LaundryNONEW04:47:20DRY STORE
16500-35871512SL1120721234CBIRTHIS29 Aug 2022GLOVE SILVERLINED 88-350 SZ8999Gloves for LaundryNONEW04:48:07DRY STORE
17500-3587878SL1120721234CBIRTHIS29 Aug 2022GLOVE SILVERLINED 88-350 SZ9999Gloves for LaundryNONEW04:48:37DRY STORE
18500-3587892SL1120721234CBIRTHIS29 Aug 2022GLOVE SILVERLINED 88-350 SZ10999Gloves for LaundryNONEW04:48:59DRY STORE
19500-2075042SL1111901234CBIRTHIS29 Aug 2022GLOVE DISPOSABLE SHOULDER LENGTH PLASTIC496Suho KangNONEW04:58:47DRY STORE
20500-2679382SL1111901234CBIRTHIS29 Aug 2022GLOVE NITRILE G/T TOUCH BLUE SZ L496Suho KangNONEW04:59:03
21500-2188722SL1113961234CBIRTHIS29 Aug 2022GLOVES BEAVER NAVY WITH YELLOW STIPLES484Kaminieli VaroNONEW05:05:52DRY STORE
22500-2188722SL1113961234CBIRTHIS29 Aug 2022GLOVES BEAVER NAVY WITH YELLOW STIPLES421Tevita Ralumu TagaNONEW05:06:07DRY STORE
23500-2075042SL1111901234CBIRTHIS29 Aug 2022GLOVE DISPOSABLE SHOULDER LENGTH PLASTIC72Owen BulehiteNONEW05:14:47DRY STORE
24500-2679382SL1111901234CBIRTHIS29 Aug 2022GLOVE NITRILE G/T TOUCH BLUE SZ L72Owen BulehiteNONEW05:15:06
25500-2083081SL1110201234CBIRTHIS29 Aug 2022APRON PVC 90 X 120 WHITE254Luke FisherNONEW05:32:05DRY STORE
26500-2679382SL1110201234CBIRTHIS29 Aug 2022GLOVE NITRILE G/T TOUCH BLUE SZ L142Najabullah Rezae NONEW05:32:23
27500-20890520SL1110201234CBIRTHIS29 Aug 2022CARTRIDGES GREEN STUNNER BX1000414Joel DempseyNONEW05:38:14KNIFE FLAM
28500-267925500SL1110201234CBIRTHIS29 Aug 2022O RING WHITE LARGE 'D' 15MM214Celeste NugasNONEW05:39:11DRY STORE
29500-2083081SL1110201234SROLFE29 Aug 2022APRON PVC 90 X 120 WHITE92Chunbo GeYESNEW05:42:41DRY STORE
30500-2083081SL1110201234SROLFE29 Aug 2022APRON PVC 90 X 120 WHITE112Yingliang (Leon) ChenYESNEW05:46:22DRY STORE
31500-2064961SL1110201234LPRIOR29 Aug 2022GLOVES NITTY GRITTY (12PR BOX)180Emma CassidyNOREPLACED06:08:31DRY STORE
32500-2042441SL1111901234LPRIOR29 Aug 2022SQUEEGEE RED 600MM39Allan EpworthNONEW06:18:39DRY STORE
33500-2642851SL1110201234SROLFE29 Aug 2022COUNTER TALLY DESKTOP 2 BANK 4 DIGIT D21Maintenance NONEW06:45:43DRY STORE
34500-2210801SL1111901234LPRIOR29 Aug 2022GLOVE POLAR BEAR DARK BLUE SZ 995Marde Dave O PerezNOREPLACED07:46:32DRY STORE
35500-2075071SL1113001234LPRIOR29 Aug 2022GLASSES SAFETY ANTI FOG CLEAR MEVX2C452Avish MalikNONEW08:13:12DRY STORE
36500-2188722SL1113961234LPRIOR29 Aug 2022GLOVES BEAVER NAVY WITH YELLOW STIPLES449Shaun LyonsYESNEW08:44:28DRY STORE
37500-2071341SL1113961234LPRIOR29 Aug 2022GLOVES COTTON KNITTED449Shaun LyonsYESNEW08:44:46DRY STORE
38500-2083081SL1113001234LPRIOR29 Aug 2022APRON PVC 90 X 120 WHITE471Phineas SamuNONEW09:33:51DRY STORE
39500-2290772SL1113001234LPRIOR29 Aug 2022GLOVE GREEN PVC DOUBLE DIP 45CM471Phineas SamuNONEW09:34:12DRY STORE
40500-2210782SL1110201234NSUKWIPAD29 Aug 2022GLOVE POLAR BEAR RED SZ 7378Jerry FrancisNONEW13:11:37DRY STORE
41500-2078081SL1110201234NSUKWIPAD29 Aug 2022BOOT PU GREEN BEKINA STEPLITEX SZ 10350Jimson SaleNONEW13:20:50GUMBOOTS
42500-2210812SL1111901234MARK29 Aug 2022GLOVE POLAR BEAR BLACK SZ 10150Mathew LeahyYESNEW14:27:22DRY STORE
43500-2210811SL1111901234MARK29 Aug 2022GLOVE POLAR BEAR BLACK SZ 10173Leonard LyonsYESNEW14:29:32DRY STORE
44500-2210802SL1111901234MARK29 Aug 2022GLOVE POLAR BEAR DARK BLUE SZ 9412Manasa RavokiYESNEW14:42:23DRY STORE
45500-2210791SL1111901234MARK29 Aug 2022GLOVE POLAR BEAR YELLOW SZ 8403Christopher TobinYESNEW14:58:55DRY STORE
46500-2072271SL1111901234MARK29 Aug 2022GLOVES FREEZER FUR LINED146Carl PateniaYESNEW17:26:12DRY STORE
47500-2210802SL1111901234NSUKWIPAD29 Aug 2022GLOVE POLAR BEAR DARK BLUE SZ 9388Mohammad Hassan Mohammad HassanYESNEW19:29:32DRY STORE
48500-3587137SL1120721234CBIRTHIS30 Aug 2022GLOVE SILVERLINED 88-350 SZ7999Gloves for LaundryNONEW04:42:17DRY STORE
49500-35871513SL1120721234CBIRTHIS30 Aug 2022GLOVE SILVERLINED 88-350 SZ8999Gloves for LaundryNONEW04:42:39DRY STORE
50500-3587872SL1120721234CBIRTHIS30 Aug 2022GLOVE SILVERLINED 88-350 SZ9999Gloves for LaundryNONEW04:42:58DRY STORE
51500-3587892SL1120721234CBIRTHIS30 Aug 2022GLOVE SILVERLINED 88-350 SZ10999Gloves for LaundryNONEW04:43:25DRY STORE
52500-2210802SL1111901234CBIRTHIS30 Aug 2022GLOVE POLAR BEAR DARK BLUE SZ 9362Aukusition (Tino) SimetiNONEW05:07:40DRY STORE
53500-2075042SL1111901234CBIRTHIS30 Aug 2022GLOVE DISPOSABLE SHOULDER LENGTH PLASTIC496Suho KangNONEW05:08:07DRY STORE
54500-2679382SL1111901234CBIRTHIS30 Aug 2022GLOVE NITRILE G/T TOUCH BLUE SZ L496Suho KangNONEW05:08:24
55500-2210812SL1111901234CBIRTHIS30 Aug 2022GLOVE POLAR BEAR BLACK SZ 10173Leonard LyonsNONEW05:11:10DRY STORE
56500-2075042SL1111901234CBIRTHIS30 Aug 2022GLOVE DISPOSABLE SHOULDER LENGTH PLASTIC72Owen BulehiteNONEW05:12:49DRY STORE
57500-2679382SL1111901234CBIRTHIS30 Aug 2022GLOVE NITRILE G/T TOUCH BLUE SZ L72Owen BulehiteNONEW05:13:03
58500-2083061SL1111901234CBIRTHIS30 Aug 2022APRON PVC 90 X 120 RED407Junior BataNONEW05:28:14DRY STORE
59500-2210812SL1111901234CBIRTHIS30 Aug 2022GLOVE POLAR BEAR BLACK SZ 10300Callum PriorNONEW05:29:45DRY STORE
60500-2060151SL1110201234CBIRTHIS30 Aug 2022STEEL F **** 12IN COMBI SQUARE 7-5982-3092Chunbo GeNONEW05:40:26
61500-2075071SL1110201234CBIRTHIS30 Aug 2022GLASSES SAFETY ANTI FOG CLEAR MEVX2C92Chunbo GeYESNEW05:44:56DRY STORE
62500-2188722SL1113961234LPRIOR30 Aug 2022GLOVES BEAVER NAVY WITH YELLOW STIPLES202Rodney Price BonungaYESNEW05:58:30DRY STORE
63500-207134113961234LPRIOR30 Aug 2022GLOVES COTTON KNITTED202Rodney Price BonungaYESNEW05:58:57DRY STORE
64500-2188121SL1111901234LPRIOR30 Aug 2022EARMUFFS PELTOR H7P3E CLIP-ON35Richard MarksNONEW06:35:53DRY STORE
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
P2:P64Cell Valuecontains "KNIFE"textNO
P2:SP64Cell Valuecontains "BOOTS"textNO
N2:O64Cell Valuecontains "KNIFE CUPB"textNO

Hi,

Can you provide us the data of the 2nd spreadsheet as XLBB?

Are those actual worksheet names? Those worksheets are in the same workbook?

VBA Code:
Set shDLSAP = Sheets("GoodsIssuedToSap_20220829_131456.xlsx") 'Change here to suit actual sheet name
Set shIssues = Sheets("store tally report - MASTER.xlsm") 'Change here to suit actual sheet name
The Issues sheet is one workbook called "store tally report - MASTER.xlsm The downloaded spreadsheet is another workbook called "goodsissuetosap ... then the date changes, so two different workbooks. Here below, I copied a section of the store tally report - MASTER.xlsm into another spreadsheet to produce a XLbb:
 
Upvote 0
Book7
ABCDEFGHIJKLMNOP
1SAPQty BLANKSLOCDepartmentIssuerDATEDescriptionLaundry IDName Blank2Supervisor SlipReplaced/NewTimeblank3Storage Location
2500-2200921SL1111901234LPRIOR26 Aug 2022SLEEVE 50CM CUT-RESISTANT GREY CUFF 93.79Jev Bajalia BarabadNONEW12:14:44DRY STORE
3500-2210782SL1110201234NSUKWIPAD26 Aug 2022GLOVE POLAR BEAR RED SZ 755Shengzhen JiaoNONEW12:59:09DRY STORE
4500-2029711SL1110201234MARK26 Aug 2022STEEL **** COMBI 7-3882-25-66379Brodie McGillivrayNONEW13:38:22KNIFE ST8
5500-3587131SL1110201234MARK26 Aug 2022GLOVE SILVERLINED 88-350 SZ7999Gloves for LaundryNONEW13:48:54DRY STORE
6500-3587152SL1110201234MARK26 Aug 2022GLOVE SILVERLINED 88-350 SZ8999Gloves for LaundryNONEW13:50:14DRY STORE
7500-2210801SL1111901234MARK26 Aug 2022GLOVE POLAR BEAR DARK BLUE SZ 9238Theresa GalosalaYESNEW14:37:12DRY STORE
8500-2698921SL1111901234MARK26 Aug 2022BOOT PU GREEN BEKINA STEPLITEX SZ 9392Erwin EncarnacionYESREPLACED14:45:09GUMBOOTS
9500-2075071SL1111901234MARK26 Aug 2022GLASSES SAFETY ANTI FOG CLEAR MEVX2C18Chass MarshallYESNEW14:55:29DRY STORE
10500-2072271SL1113961234MARK26 Aug 2022GLOVES FREEZER FUR LINED472Ismail Bin AdamsYESREPLACED14:56:22DRY STORE
11500-2210802SL1111901234MARK26 Aug 2022GLOVE POLAR BEAR DARK BLUE SZ 9428Maikeli WaituiYESNEW15:10:50DRY STORE
12500-2210812SL1111901234NSUKWIPAD26 Aug 2022GLOVE POLAR BEAR BLACK SZ 10403Christopher TobinYESNEW15:27:06DRY STORE
13500-2188121SL1111901234NSUKWIPAD26 Aug 2022EARMUFFS PELTOR H7P3E CLIP-ON150Mathew LeahyYESNEW16:49:55DRY STORE
14500-2075071SL1111901234NSUKWIPAD26 Aug 2022GLASSES SAFETY ANTI FOG CLEAR MEVX2C423Moo NayYESNEW17:04:40DRY STORE
15500-3587135SL1120721234CBIRTHIS29 Aug 2022GLOVE SILVERLINED 88-350 SZ7999Gloves for LaundryNONEW04:47:20DRY STORE
16500-35871512SL1120721234CBIRTHIS29 Aug 2022GLOVE SILVERLINED 88-350 SZ8999Gloves for LaundryNONEW04:48:07DRY STORE
17500-3587878SL1120721234CBIRTHIS29 Aug 2022GLOVE SILVERLINED 88-350 SZ9999Gloves for LaundryNONEW04:48:37DRY STORE
18500-3587892SL1120721234CBIRTHIS29 Aug 2022GLOVE SILVERLINED 88-350 SZ10999Gloves for LaundryNONEW04:48:59DRY STORE
19500-2075042SL1111901234CBIRTHIS29 Aug 2022GLOVE DISPOSABLE SHOULDER LENGTH PLASTIC496Suho KangNONEW04:58:47DRY STORE
20500-2679382SL1111901234CBIRTHIS29 Aug 2022GLOVE NITRILE G/T TOUCH BLUE SZ L496Suho KangNONEW04:59:03 
21500-2188722SL1113961234CBIRTHIS29 Aug 2022GLOVES BEAVER NAVY WITH YELLOW STIPLES484Kaminieli VaroNONEW05:05:52DRY STORE
22500-2188722SL1113961234CBIRTHIS29 Aug 2022GLOVES BEAVER NAVY WITH YELLOW STIPLES421Tevita Ralumu TagaNONEW05:06:07DRY STORE
23500-2075042SL1111901234CBIRTHIS29 Aug 2022GLOVE DISPOSABLE SHOULDER LENGTH PLASTIC72Owen BulehiteNONEW05:14:47DRY STORE
24500-2679382SL1111901234CBIRTHIS29 Aug 2022GLOVE NITRILE G/T TOUCH BLUE SZ L72Owen BulehiteNONEW05:15:06 
25500-2083081SL1110201234CBIRTHIS29 Aug 2022APRON PVC 90 X 120 WHITE254Luke FisherNONEW05:32:05DRY STORE
26500-2679382SL1110201234CBIRTHIS29 Aug 2022GLOVE NITRILE G/T TOUCH BLUE SZ L142Najabullah Rezae NONEW05:32:23 
27500-20890520SL1110201234CBIRTHIS29 Aug 2022CARTRIDGES GREEN STUNNER BX1000414Joel DempseyNONEW05:38:14KNIFE FLAM
28500-267925500SL1110201234CBIRTHIS29 Aug 2022O RING WHITE LARGE 'D' 15MM214Celeste NugasNONEW05:39:11DRY STORE
29500-2083081SL1110201234SROLFE29 Aug 2022APRON PVC 90 X 120 WHITE92Chunbo GeYESNEW05:42:41DRY STORE
30500-2083081SL1110201234SROLFE29 Aug 2022APRON PVC 90 X 120 WHITE112Yingliang (Leon) ChenYESNEW05:46:22DRY STORE
31500-2064961SL1110201234LPRIOR29 Aug 2022GLOVES NITTY GRITTY (12PR BOX)180Emma CassidyNOREPLACED06:08:31DRY STORE
32500-2042441SL1111901234LPRIOR29 Aug 2022SQUEEGEE RED 600MM39Allan EpworthNONEW06:18:39DRY STORE
33500-2642851SL1110201234SROLFE29 Aug 2022COUNTER TALLY DESKTOP 2 BANK 4 DIGIT D21Maintenance NONEW06:45:43DRY STORE
34500-2210801SL1111901234LPRIOR29 Aug 2022GLOVE POLAR BEAR DARK BLUE SZ 995Marde Dave O PerezNOREPLACED07:46:32DRY STORE
35500-2075071SL1113001234LPRIOR29 Aug 2022GLASSES SAFETY ANTI FOG CLEAR MEVX2C452Avish MalikNONEW08:13:12DRY STORE
36500-2188722SL1113961234LPRIOR29 Aug 2022GLOVES BEAVER NAVY WITH YELLOW STIPLES449Shaun LyonsYESNEW08:44:28DRY STORE
37500-2071341SL1113961234LPRIOR29 Aug 2022GLOVES COTTON KNITTED449Shaun LyonsYESNEW08:44:46DRY STORE
38500-2083081SL1113001234LPRIOR29 Aug 2022APRON PVC 90 X 120 WHITE471Phineas SamuNONEW09:33:51DRY STORE
39500-2290772SL1113001234LPRIOR29 Aug 2022GLOVE GREEN PVC DOUBLE DIP 45CM471Phineas SamuNONEW09:34:12DRY STORE
40500-2210782SL1110201234NSUKWIPAD29 Aug 2022GLOVE POLAR BEAR RED SZ 7378Jerry FrancisNONEW13:11:37DRY STORE
41500-2078081SL1110201234NSUKWIPAD29 Aug 2022BOOT PU GREEN BEKINA STEPLITEX SZ 10350Jimson SaleNONEW13:20:50GUMBOOTS
42500-2210812SL1111901234MARK29 Aug 2022GLOVE POLAR BEAR BLACK SZ 10150Mathew LeahyYESNEW14:27:22DRY STORE
43500-2210811SL1111901234MARK29 Aug 2022GLOVE POLAR BEAR BLACK SZ 10173Leonard LyonsYESNEW14:29:32DRY STORE
44500-2210802SL1111901234MARK29 Aug 2022GLOVE POLAR BEAR DARK BLUE SZ 9412Manasa RavokiYESNEW14:42:23DRY STORE
45500-2210791SL1111901234MARK29 Aug 2022GLOVE POLAR BEAR YELLOW SZ 8403Christopher TobinYESNEW14:58:55DRY STORE
46500-2072271SL1111901234MARK29 Aug 2022GLOVES FREEZER FUR LINED146Carl PateniaYESNEW17:26:12DRY STORE
47500-2210802SL1111901234NSUKWIPAD29 Aug 2022GLOVE POLAR BEAR DARK BLUE SZ 9388Mohammad Hassan Mohammad HassanYESNEW19:29:32DRY STORE
48500-3587137SL1120721234CBIRTHIS30 Aug 2022GLOVE SILVERLINED 88-350 SZ7999Gloves for LaundryNONEW04:42:17DRY STORE
49500-35871513SL1120721234CBIRTHIS30 Aug 2022GLOVE SILVERLINED 88-350 SZ8999Gloves for LaundryNONEW04:42:39DRY STORE
50500-3587872SL1120721234CBIRTHIS30 Aug 2022GLOVE SILVERLINED 88-350 SZ9999Gloves for LaundryNONEW04:42:58DRY STORE
51500-3587892SL1120721234CBIRTHIS30 Aug 2022GLOVE SILVERLINED 88-350 SZ10999Gloves for LaundryNONEW04:43:25DRY STORE
52500-2210802SL1111901234CBIRTHIS30 Aug 2022GLOVE POLAR BEAR DARK BLUE SZ 9362Aukusition (Tino) SimetiNONEW05:07:40DRY STORE
53500-2075042SL1111901234CBIRTHIS30 Aug 2022GLOVE DISPOSABLE SHOULDER LENGTH PLASTIC496Suho KangNONEW05:08:07DRY STORE
Sheet1
Cell Formulas
RangeFormula
D2:D53D2=IF(ISBLANK(A2),"",IF(ISNUMBER(SEARCH("500",A2)),"SL11","SL02"))
H2:H53H2=IF(ISBLANK(A2),"",VLOOKUP(A2,'[store tally report - MASTER.xlsm]Product Lookup List'!$A:$D,3,FALSE))
J2J2=IF(ISBLANK(#REF!),"",VLOOKUP($I2,'[store tally report - MASTER.xlsm]Laundry List'!$A$1:$B$462,2,FALSE))
J3:J53J3=IF(ISBLANK($I2),"",VLOOKUP($I3,'[store tally report - MASTER.xlsm]Laundry List'!$A$1:$B$462,2,FALSE))
N2:N53N2=IF(ISBLANK($G2),"",$G2-INT($G2))
P2:P53P2=IF(ISBLANK(A2),"",VLOOKUP(A2,'[store tally report - MASTER.xlsm]Product Lookup List'!$A:$D,4,FALSE))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
P2:P53Cell Valuecontains "KNIFE"textNO
P2:P53Cell Valuecontains "BOOTS"textNO
N2:O53Cell Valuecontains "KNIFE CUPB"textNO
Cells with Data Validation
CellAllowCriteria
D2:D53List='[store tally report - MASTER.xlsm]Validation'!#REF!
K2:L53List='[store tally report - MASTER.xlsm]Data Validation'!#REF!
M2:M53List='[store tally report - MASTER.xlsm]Data Validation'!#REF!
 
Upvote 0
so, I need to copy columns A through to H and from YELLOW highlighted to YELLOW highlighted each day from store tally report - MASTER.xlsm and then paste special (value) to the next empty line in Goodsissuedtosap spreadsheet starting at Column D so that the SAP numbers follow on.
 
Upvote 0
I have organized the conditions presented to us and set the assumptions as follows If my understanding is wrong at this point, the code will not work, so please check these preconditions first.

Workbook#0 - This workbook which has a program code.
Workbook#1 - Titled "MASTER.xlsm" which has a worksheet titled "Issues".
Workbook#2 - Titles "goodsissuetosap" which has one worksheet. The name of the worksheet was created based on the date.

Place the following code on Workbook#0 and then run the code.
So the program would ask you to select Workbook#1 and Workbook#2, so please select workbooks.
Seems no data was generated on Saturdays and Sundays, so I set the filtered term for 2 business days based on yesterday.

VBA Code:
Sub Sample2()
    Dim shDLSAP As Worksheet    'SAP worksheet
    Dim shIssues As Worksheet    'Issues worksheet
    Dim shTemp As Worksheet    'Temporary helper worksheet
    Dim dtCnt As Long
    Dim stDate As Date, endDate As Date

    Dim OpenFileName As String

    OpenFileName = Application.GetOpenFilename("Excel Files,*.xls?", , "Open Issue workbook")
    If OpenFileName <> "False" Then
        Workbooks.Open OpenFileName
        Set shIssues = Sheets("issues")    'Change here to suit actual sheet name
    End If

    OpenFileName = Application.GetOpenFilename("Excel Files,*.xls?", , "Open goodsissuetosap workbook")
    If OpenFileName <> "False" Then
        Workbooks.Open OpenFileName
        Set shDLSAP = Sheets(1)    'Assume there is only 1 worksheet has been generated
    End If

    Set shTemp = Sheets.Add    'Making a temporary helper wks

    'Filter by the date between Yesterday and Today
    shIssues.Activate
    shIssues.AutoFilterMode = False

    'Seems no data on Saturdays and Sundays
    Select Case Weekday(Date)
    Case 1    'If today is Sunday
        endDate = Date - 2
        stDate = endDate - 1
    Case 2    'If today is Monday
        endDate = Date - 3
        stDate = endDate - 1
    Case 3    'If today is Tuesday
        endDate = Date - 1
        stDate = endDate - 3
    Case 4, 5, 6, 7    'If today is Wednesday to Saturday
        endDate = Date - 1
        stDate = endDate - 1
    End Select

    'Filter data
    With shIssues.UsedRange
        .AutoFilter Field:=7, Criteria1:=Format(stDate, Range("G2").NumberFormatLocal), Operator:=xlOr, Criteria2:=Format(endDate, Range("G2").NumberFormatLocal)
        .Range(.Range("A2"), .Cells(Rows.Count, "G").End(xlUp)).Copy shTemp.Range("A1")
    End With
    'Counting fildtered data
    dtCnt = shIssues.AutoFilter.Range.Columns(1).SpecialCells(xlCellTypeVisible).Count - 1
    shIssues.AutoFilterMode = False

    'Data transfer
    With shDLSAP.Cells(Rows.Count, 1).End(xlUp).Offset(1)
        .Offset(, 2).Resize(dtCnt).Value = shTemp.Range("G1").Resize(dtCnt).Value
        .Offset(, 3).Resize(dtCnt).Value = shTemp.Range("A1").Resize(dtCnt).Value
        .Offset(, 4).Resize(dtCnt).Value = shTemp.Range("B1").Resize(dtCnt).Value
        .Offset(, 6).Resize(dtCnt).Value = shTemp.Range("C1").Resize(dtCnt).Value
        .Offset(, 7).Resize(dtCnt).Value = shTemp.Range("D1").Resize(dtCnt).Value
        .Offset(, 8).Resize(dtCnt).Value = shTemp.Range("E1").Resize(dtCnt).Value
    End With

    'Deleting the helper worksheet
    Application.DisplayAlerts = False
    shTemp.Delete
    Application.DisplayAlerts = True

    'Closing the workbook which has Issues sheet
    shIssues.Parent.Close False
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
thank you. So, I can't get this to work either though. Sorry, I'm clearly not giving you the information you need!
I'll try again.
So, the Issues Workbook is called "store tally report - MASTER.xlsm" It has six worksheets in it, but the information I require is on the first worksheet only - which is simply called "1"
The procedure I currently manually perform, is that I go to the Computer where this issues workbook is. I find the last issue entry, highlight the line in YELLOW, then save the workbook.
I then download the workbook from SAP and it saves it locally as "goodsissedtosap******" and puts a timestamp date - so filename is never the same.
So, now I have two workbooks open - the "store tally report - Master.xlsm"(it always opens read-only as it is constantly open on another computer) and the "goodsissuedtoSAPxxxx".
I then highlight from column A to G on the first line under the last yellow highlighted row (which is yesterdays date) down to the yellow highlighted row from today and COPY. So, I have maybe 30 rows of information, seven columns wide.
With that information on the clipboard, I got to the goodsissuedtosap workbook, click in column d under the last line of data and PASTE the information in (so that the SAP numbers line up).
I hope that helps?
 
Upvote 0
Hi,

Still no time to check those what you provided. For a while I'm going to be busy, so I'll have a look when I have time. Hope other members also helps. ;)
 
Upvote 0

Forum statistics

Threads
1,215,949
Messages
6,127,888
Members
449,411
Latest member
AppellatePerson

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