VBA Search for match, if found, clear content in match rows

Engalpengal

New Member
Joined
May 10, 2023
Messages
43
Office Version
  1. 365
Platform
  1. Windows
Hello.
I am working on a project, where i want to track products in our factory.
The process start by me loading orders in a workbook called "Ordre"
It is a list of products with information spread out in rows C:P - See Pic 1
When a process is done, a date is filled in Q:AF depending on witch prosess that is completed (VBA program). These columns is hidden. - See Pic 2
In column AH:AV I have excel formulas that shows If the product should go throug the process (No=x, Yes=Process desc ex. PR), or if the process is done(Done=V). - See Pic 3

Ex of formulas:
=IF(C22<1;"";IF(AE22>1;"V";XLOOKUP(F22;BOM!A:A;BOM!AC:AC;"x";0)))

With a click of a button all Product lines With "V" in column AV (the last process) is copied into av workbook called History.

Now i need to cleare (ClearContents) the same lines that was copied into History, from workbook "Ordre".

Under follows my attempt.
The program does not give me an Error, but nothing happens either, other than the workbook is thinking.
So what am i doing wrong?

VBA Code:
Sub Fjern_ferdig()

unprotect
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual

Dim wbo As Workbook
Dim wsSrc As Worksheet
Dim i As Integer

Set wbo = ThisWorkbook
Set wsSrc = wbo.Worksheets("Ordre") '______________________________________________________Sheet for search area
Set srcKey = wsSrc.Range("AV8") '___________________________________________________________Search key (The cell contains the letter V)

finalrow = wsSrc.Range("AV1000").End(xlUp).Row '__________________________________________Setting search area (These cells contains excel formulas)

For i = 48 To finalrow
    If Cells(i, 48) = srcKey Then
        wsSrc.Range(Cells(i, 3), Cells(i, 32)).ClearContents
    End If
Next i

Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
protect
ActiveWorkbook.Save

End Sub

Sub unprotect()
ActiveSheet.unprotect "1234"

End Sub

Sub protect()
ActiveSheet.protect "1234"

End Sub
 

Attachments

  • Pic 1.jpg
    Pic 1.jpg
    148.3 KB · Views: 30
  • Pic 2.jpg
    Pic 2.jpg
    174.9 KB · Views: 28
  • Pic 3.jpg
    Pic 3.jpg
    64.8 KB · Views: 25
Sorry about this. First time trying.
You where thinking of me pasting a mini sheet in here correct?
Correct. Mr Excel has a section called Test Here, where you can practice such things as inserting mini sheets etc. I've used it myself a number of times.
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Here go`s
"Ordre"

Ordre-Spor.xlsm
ABCDEFGHIJKLMNOPAHAIAJAKALAMANAV
8Ordre i arbeid
9
10Prosesser
11StatusOrdre nrSalgsordre datoForv.fors.datoProdukt nrProduktbeskrivelsePosLengde, mmBredde, mmEkstra infoFarge RALAntKunde nrKunde navnOrdre ansPLPLMOVPRSKSSKSKVDLA
12-----------------------
1396484131.05.202305.08.202311051612132Skilt nr 516VH LS R-kl 3 Tosidig H=hldr Gangfelt1778899Hedlund BilMMNytt prodxxxVxxx
1496484131.05.202305.08.202311052200131Skilt nr 522 R-kl 3 H=klmr Gang- og sykkelvegSkjæring1778899Hedlund BilMMNytt prodxxxVxxx
1596484131.05.202305.08.202312010808200Skilt R.kl 1 H=klmr - Møteplass ved brann/evakueringGul-grønn fluor.2778899Hedlund BilMMNytt prodxxxVxxx
1696484131.05.202305.08.202341690000310Underskilt for foldeskilt, Nøytrale underskilt gul2778899Hedlund BilMMNytt prodxxxVxxx
1796535701.06.202308.08.202311072902122Skilt nr 729 R-kl 2 Gatenavn tosidig (10 bokst. TH=70mm)1123456NAF FjellstuenTRNytt prodxxxxxxx
1896564002.06.202308.08.202321020089400Stolpe, 89 mm/4,0 m60121958647Melund TrafikkKRNytt prodxOVxxxxx
1996564002.06.202310.08.202321970000500Omstillingskostnad, lakkering1958647Melund TrafikkKRNytt prodxxxxxxx
2096564002.06.202310.08.202391010101000Frakt totalt1123456NAF FjellstuenTRNytt prodxxxxxxx
2185446323.04.202311.08.202311040210111Skilt nr 402.1 LS R-kl 1 H=klmr Påbudt kjøreretning1966322Finsnes AutobaneILNytt prodxxxxxxx
2285446323.04.202311.08.202321010060250Stolpe, 60 mm/2,5 m1966322Finsnes AutobaneILPLxxxxxxLA
2385446323.04.202311.08.202321127060000Klammer rett, alu., 60 mm, ensidig kompl. m/skrue2966322Finsnes AutobaneILxxxxxxxLA
2411223312.04.202314.08.202311011000243Skilt nr 110 MS R-kl 3 G/GR H=nøkkel Vegarbeidflgkjdghf134100Karmøy KommuneØKxxVVxVxV
2511223312.04.202314.08.202311011000331Skilt nr 110 SS R-kl 3 G/GR H=klmr Vegarbeid125719Mesta ASMNxxVVxVxV
2611223312.04.202314.08.202311011000531Skilt nr 110 MS R-kl 3 G/GR m/bakstøtte Vegarbeid5778225719Mesta ASBURxxVVxVxV
Ordre
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AV13:AV3000Cell Valuebeginning with "LA"textNO
AV13:AV3000Cell Value="V"textNO
AN13:AN3000Cell Value="V"textNO
AN13:AN3000Cell Valuebeginning with "SK"textNO
AM13:AM3000Cell Valuebeginning with "SK"textNO
AM13:AM3000Cell Value="V"textNO
AL13:AL3000Cell Valuebeginning with "SK"textNO
AL13:AL3000Cell Value="V"textNO
AK13:AK3000Cell Value="V"textNO
AK13:AK3000Cell Valuebeginning with "PR"textNO
AJ13:AJ5000Cell Value="Nytt prod"textNO
AJ13:AJ5000Cell Value="V"textNO
AJ13:AJ5000Cell Valuebeginning with "OV"textNO
AI13:AI3000Cell Value="V"textNO
AH13:AH3000Cell Value="Nytt prod"textNO
E13:E2000Dates OccurringyesterdaytextNO
E13:E2000Dates OccurringtodaytextNO
E13:E2000Dates OccurringtomorrowtextNO
E13:E2000Dates Occurringlast 7 daystextNO
E13:E2000Dates Occurringthis weektextNO
E13:E2000Dates Occurringlast monthtextNO
E13:E2000Dates Occurringlast weektextNO
AH13:AH3000Cell Value="V"textNO
AI13:AI3000Cell Valuebeginning with "PLM"textNO
AH13:AH3000Cell Valuebeginning with "PL"textNO
B13:B26051Cell Value<0textNO
B13:B26051Cell Valuebeginning with "PL"textNO
B13:B26051Cell Valuebeginning with "PR"textNO
B13:B26051Cell Valuebeginning with "OV"textNO
B13:B26051Cell Valuebeginning with "SK"textNO
B13:B26051Cell Valuebeginning with "LA"textNO
 
Upvote 0
"Hist"
Hist.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
2Ordrehistorikk
3
4
5
6
7Ordre nrSalgsordre datoForv.fors.datoProdukt nrProduktbeskrivelsePosLengde, mmBredde, mmEkstra infoFarge RALAntKunde nrKunde navnOrdre ansPL, datoPLM, datoOV, datoPR, datoSKS, datoSK, datoSKVD, datoMA, datoLE, datoMV, datoVA, datoBSS, datoCS, datoCSF, datoLA, datoPiU, datoLedetid, dager
8-------------------------------
9
10
11
12
13
14
15
16
17
18
Hist
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C10Dates OccurringyesterdaytextNO
C10Dates OccurringtodaytextNO
C10Dates OccurringtomorrowtextNO
C10Dates Occurringlast 7 daystextNO
C10Dates Occurringthis weektextNO
C10Dates Occurringlast monthtextNO
C10Dates Occurringlast weektextNO
O10:AD10Cell Value>1textNO
O10:AD10Cell Value>0textNO
C9Dates OccurringyesterdaytextNO
C9Dates OccurringtodaytextNO
C9Dates OccurringtomorrowtextNO
C9Dates Occurringlast 7 daystextNO
C9Dates Occurringthis weektextNO
C9Dates Occurringlast monthtextNO
C9Dates Occurringlast weektextNO
O9:AD9Cell Value>1textNO
O9:AD9Cell Value>0textNO
C11:C501Dates OccurringyesterdaytextNO
C11:C501Dates OccurringtodaytextNO
C11:C501Dates OccurringtomorrowtextNO
C11:C501Dates Occurringlast 7 daystextNO
C11:C501Dates Occurringthis weektextNO
C11:C501Dates Occurringlast monthtextNO
C11:C501Dates Occurringlast weektextNO
O11:AD501Cell Value>1textNO
O11:AD501Cell Value>0textNO
 
Upvote 0
I'm assuming you're looking for a solution to your post #16 code? (The new code you wrote). If that's the case, how do you determine the value srcKey? There's nothing in cell AG12 in the minisheet you posted for the Ordre sheet.
Set srcKey = wsSrc.Range("AG12")
Is it meant to be "1" - "Search key (The cell contains the nuber 1)" - or is it meant to be the letter "V"? And in either case, does it change at all or is it fixed? I take it you want the code to open the Hist file?
 
Upvote 0
If you have hidden columns in either sheet, please unhide them before you create the mini-sheets.
 
Upvote 0
Assuming whatever is in cell AG12 on the sheet Ordre is the correct value to determine wat to copy to the Hist sheet, try the following on copies of your workbooks.
VBA Code:
Option Explicit
Sub Remove_ord_2()
    With Application
        .Calculation = xlManual
        .ScreenUpdating = False
    End With
    Dim wbo As Workbook, wbh As Workbook, FileName As String
    Set wbo = ThisWorkbook

    FileName = "C:\Angel\Produksjonsstyring\ProdSpor\Hist.xlsm"
    Set wbh = Workbooks.Open(FileName)

    Dim wsSrc As Worksheet, wsHi As Worksheet, srcKey As String, LRow As Long
    Set wsSrc = wbo.Worksheets("Ordre")
    Set wsHi = wbh.Worksheets("Hist")
    LRow = wsSrc.Cells.Find("*", , xlFormulas, , 1, 2).Row
    srcKey = wsSrc.Range("AG12").Value

    If wsSrc.AutoFilterMode Then wsSrc.AutoFilter.ShowAllData
    With wsSrc.Range(wsSrc.Cells(11, 2), wsSrc.Cells(LRow, 48))
        .AutoFilter 47, srcKey
        .Offset(1, 1).Resize(.Rows.Count - 1, 30).Copy _
        wsHi.Cells(Rows.Count, "A").End(xlUp).Offset(1)
        .AutoFilter
    End With    
    With Application
        .Calculation = xlAutomatic
        .ScreenUpdating = True
    End With
    wbo.Save
    wbh.Close True
End Sub
 
Upvote 0
Now no hidden Columns....

Ordre-Spor.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAV
7
8Ordre i arbeid
9
10Dato for utført prosessProsesser
11StatusOrdre nrSalgsordre datoForv.fors.datoProdukt nrProduktbeskrivelsePosLengde, mmBredde, mmEkstra infoFarge RALAntKunde nrKunde navnOrdre ansPL, datoPLM, datoOV, datoPR, datoSKS, datoSK, datoSKVD, datoMA, datoLE, datoMV, datoVA, datoBSS, datoCS, datoCSF, datoLA, datoPiU, datoPLPLMOVPRSKSSKSKVDMALEMVVABS-SCS-SCS-FLA
12-------------------------------1---------------
1396484131.05.202305.08.202311051612132Skilt nr 516VH LS R-kl 3 Tosidig H=hldr Gangfelt1778899Hedlund BilMM00.01.190000.01.190000.01.190000.01.1900#######00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxVxx0000000x
1496484131.05.202305.08.202311052200131Skilt nr 522 R-kl 3 H=klmr Gang- og sykkelvegSkjæring1778899Hedlund BilMM00.01.190000.01.190000.01.190000.01.1900#######00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxVxx0000000x
1596484131.05.202305.08.202312010808200Skilt R.kl 1 H=klmr - Møteplass ved brann/evakueringGul-grønn fluor.2778899Hedlund BilMM00.01.190000.01.190000.01.190000.01.1900#######00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxVxx0000000x
1696484131.05.202305.08.202341690000310Underskilt for foldeskilt, Nøytrale underskilt gul2778899Hedlund BilMM00.01.190000.01.190000.01.190000.01.1900#######00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxVxx0000000x
1796535701.06.202308.08.202311072902122Skilt nr 729 R-kl 2 Gatenavn tosidig (10 bokst. TH=70mm)1123456NAF FjellstuenTR00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxxxx0000000x
1896564002.06.202308.08.202321020089400Stolpe, 89 mm/4,0 m60121958647Melund TrafikkKR00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxOVxxxx0000000x
1996564002.06.202310.08.202321970000500Omstillingskostnad, lakkering1958647Melund TrafikkKR00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxxxx0000000x
2096564002.06.202310.08.202391010101000Frakt totalt1123456NAF FjellstuenTR00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxxxx0000000x
2185446323.04.202311.08.202311040210111Skilt nr 402.1 LS R-kl 1 H=klmr Påbudt kjøreretning1966322Finsnes AutobaneIL00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxxxx0000000x
2285446323.04.202311.08.202321010060250Stolpe, 60 mm/2,5 m1966322Finsnes AutobaneIL00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900PLxxxxxxxxxxxxxLA
2385446323.04.202311.08.202321127060000Klammer rett, alu., 60 mm, ensidig kompl. m/skrue2966322Finsnes AutobaneIL00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900xxxxxxxxxxxxxxLA
Ordre
Cell Formulas
RangeFormula
AH13:AH23AH13=IF(C13<1,"",IF(Q13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!O:O,"Nytt prod",0)))
AI13:AI23AI13=IF(C13<1,"",IF(R13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!P:P,"x",0)))
AJ13:AJ23AJ13=IF(C13<1,"",IF(S13>1,"V",IF(L13>1,"OV",IF(L13<1,"x",0))))
AK13:AK23AK13=IF(C13<1,"",IF(T13>1,"V",IF(AL13=$AL$11,"x",IF(AL13="V","x",XLOOKUP(F13,BOM!A:A,BOM!R:R,"x",0)))))
AL13:AL23AL13=IF(C13<1,"",IF(U13>1,"V",IF(ISNUMBER(SEARCH("skjær",K13)),"SKS",XLOOKUP(F13,BOM!A:A,BOM!S:S,"x",0))))
AM13:AM23AM13=IF(C13<1,"",IF(V13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!T:T,"x",0)))
AN13:AN23AN13=IF(C13<1,"",IF(W13>1,"V",IF(ISNUMBER(SEARCH("VD",G13)),"SKVD",XLOOKUP(F13,BOM!A:A,BOM!U:U,"x",0))))
AO13:AO23AO13=IF(X13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!V:V,"0",0))
AP13:AP23AP13=IF(Y13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!W:W,"0",0))
AQ13:AQ23AQ13=IF(Z13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!X:X,"0",0))
AR13:AR23AR13=IF(AA13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!Y:Y,"0",0))
AS13:AS23AS13=IF(AB13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!Z:Z,"0",0))
AT13:AT23AT13=IF(AC13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!AA:AA,"0",0))
AU13:AU23AU13=IF(AD13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!AB:AB,"0",0))
AV13:AV23AV13=IF(C13<1,"",IF(AE13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!AC:AC,"x",0)))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AV13:AV3000Cell Valuebeginning with "LA"textNO
AV13:AV3000Cell Value="V"textNO
AN13:AN3000Cell Value="V"textNO
AN13:AN3000Cell Valuebeginning with "SK"textNO
AM13:AM3000Cell Valuebeginning with "SK"textNO
AM13:AM3000Cell Value="V"textNO
AL13:AL3000Cell Valuebeginning with "SK"textNO
AL13:AL3000Cell Value="V"textNO
AK13:AK3000Cell Value="V"textNO
AK13:AK3000Cell Valuebeginning with "PR"textNO
AJ13:AJ5000Cell Value="Nytt prod"textNO
AJ13:AJ5000Cell Value="V"textNO
AJ13:AJ5000Cell Valuebeginning with "OV"textNO
AI13:AI3000Cell Value="V"textNO
AH13:AH3000Cell Value="Nytt prod"textNO
E13:E2000Dates OccurringyesterdaytextNO
E13:E2000Dates OccurringtodaytextNO
E13:E2000Dates OccurringtomorrowtextNO
E13:E2000Dates Occurringlast 7 daystextNO
E13:E2000Dates Occurringthis weektextNO
E13:E2000Dates Occurringlast monthtextNO
E13:E2000Dates Occurringlast weektextNO
AH13:AH3000Cell Value="V"textNO
Q13:AF1048576Cell Value>1textNO
Q13:AF1048576Cell Value>0textNO
AI13:AI3000Cell Valuebeginning with "PLM"textNO
AH13:AH3000Cell Valuebeginning with "PL"textNO
B13:B26051Cell Value<0textNO
B13:B26051Cell Valuebeginning with "PL"textNO
B13:B26051Cell Valuebeginning with "PR"textNO
B13:B26051Cell Valuebeginning with "OV"textNO
B13:B26051Cell Valuebeginning with "SK"textNO
B13:B26051Cell Valuebeginning with "LA"textNO
 
Upvote 0
Thanks for that - only problem is that you've put "1" in cell AG12 - and no cell in column AV has a "1" or is likely to get one. I changed the value in AG12 to "V" and tested the code in post #26 and it still worked OK (once I forced some cells in AV to become Vs).
 
Upvote 0
Now I hope this makes sense to you
The 1 in col AG appears when a process is completed, just like the date in col Q:AF
1 means that all processes are finished and the product line is ready to be transferred to History

Ordre-Spor.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAV
10Dato for utført prosessProsesser
11StatusOrdre nrSalgsordre datoForv.fors.datoProdukt nrProduktbeskrivelsePosLengde, mmBredde, mmEkstra infoFarge RALAntKunde nrKunde navnOrdre ansPL, datoPLM, datoOV, datoPR, datoSKS, datoSK, datoSKVD, datoMA, datoLE, datoMV, datoVA, datoBSS, datoCS, datoCSF, datoLA, datoPiU, datoPLPLMOVPRSKSSKSKVDLA
12-------------------------------1--------
1396484131.05.202305.08.202311051612132Skilt nr 516VH LS R-kl 3 Tosidig H=hldr Gangfelt1778899Hedlund BilMM00.01.190000.01.190000.01.190000.01.1900#######00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxVxxx
1496484131.05.202305.08.202311052200131Skilt nr 522 R-kl 3 H=klmr Gang- og sykkelvegSkjæring1778899Hedlund BilMM00.01.190000.01.190000.01.190000.01.1900#######00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxVxxx
1596484131.05.202305.08.202312010808200Skilt R.kl 1 H=klmr - Møteplass ved brann/evakueringGul-grønn fluor.2778899Hedlund BilMM00.01.190000.01.190000.01.190000.01.1900#######00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxVxxx
1696484131.05.202305.08.202341690000310Underskilt for foldeskilt, Nøytrale underskilt gul2778899Hedlund BilMM00.01.190000.01.190000.01.190000.01.1900#######00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxVxxx
1796535701.06.202308.08.202311072902122Skilt nr 729 R-kl 2 Gatenavn tosidig (10 bokst. TH=70mm)1123456NAF FjellstuenTR00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxxxxx
1896564002.06.202308.08.202321020089400Stolpe, 89 mm/4,0 m60121958647Melund TrafikkKR00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxOVxxxxx
1996564002.06.202310.08.202321970000500Omstillingskostnad, lakkering1958647Melund TrafikkKR00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxxxxx
2096564002.06.202310.08.202391010101000Frakt totalt1123456NAF FjellstuenTR00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxxxxx
2185446323.04.202311.08.202311040210111Skilt nr 402.1 LS R-kl 1 H=klmr Påbudt kjøreretning1966322Finsnes AutobaneIL00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxxxxx
2285446323.04.202311.08.202321010060250Stolpe, 60 mm/2,5 m1966322Finsnes AutobaneIL00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900PLxxxxxxLA
2385446323.04.202311.08.202321127060000Klammer rett, alu., 60 mm, ensidig kompl. m/skrue2966322Finsnes AutobaneIL00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900xxxxxxxLA
2411223312.04.202314.08.202311011000243Skilt nr 110 MS R-kl 3 G/GR H=nøkkel Vegarbeidflgkjdghf134100Karmøy KommuneØK00.01.190000.01.1900##############00.01.190028.08.202300.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190001.09.202300.01.19001xxVVxVxV
2511223312.04.202314.08.202311011000331Skilt nr 110 SS R-kl 3 G/GR H=klmr Vegarbeid125719Mesta ASMN00.01.190000.01.1900##############00.01.190028.08.202300.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190001.09.202300.01.19001xxVVxVxV
2611223312.04.202314.08.202311011000531Skilt nr 110 MS R-kl 3 G/GR m/bakstøtte Vegarbeid5778225719Mesta ASBUR00.01.190000.01.1900##############00.01.190028.08.202300.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190001.09.202300.01.19001xxVVxVxV
2796585905.06.202315.08.202311071300022Skilt nr 713 R-kl 2 VD Vegviser1400260LPG , TH140172532Mesta ASSKH00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxxxSKVDx
2896585905.06.202315.08.202391010101010Frakt fra fabrikk i Vingrom172532Mesta ASSKH00.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.190000.01.1900Nytt prodxxxxxxx
Ordre
Cell Formulas
RangeFormula
AH13:AH28AH13=IF(C13<1,"",IF(Q13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!O:O,"Nytt prod",0)))
AI13:AI28AI13=IF(C13<1,"",IF(R13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!P:P,"x",0)))
AJ13:AJ28AJ13=IF(C13<1,"",IF(S13>1,"V",IF(L13>1,"OV",IF(L13<1,"x",0))))
AK13:AK28AK13=IF(C13<1,"",IF(T13>1,"V",IF(AL13=$AL$11,"x",IF(AL13="V","x",XLOOKUP(F13,BOM!A:A,BOM!R:R,"x",0)))))
AL13:AL28AL13=IF(C13<1,"",IF(U13>1,"V",IF(ISNUMBER(SEARCH("skjær",K13)),"SKS",XLOOKUP(F13,BOM!A:A,BOM!S:S,"x",0))))
AM13:AM28AM13=IF(C13<1,"",IF(V13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!T:T,"x",0)))
AN13:AN28AN13=IF(C13<1,"",IF(W13>1,"V",IF(ISNUMBER(SEARCH("VD",G13)),"SKVD",XLOOKUP(F13,BOM!A:A,BOM!U:U,"x",0))))
AV13:AV28AV13=IF(C13<1,"",IF(AE13>1,"V",XLOOKUP(F13,BOM!A:A,BOM!AC:AC,"x",0)))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AV13:AV3000Cell Valuebeginning with "LA"textNO
AV13:AV3000Cell Value="V"textNO
AN13:AN3000Cell Value="V"textNO
AN13:AN3000Cell Valuebeginning with "SK"textNO
AM13:AM3000Cell Valuebeginning with "SK"textNO
AM13:AM3000Cell Value="V"textNO
AL13:AL3000Cell Valuebeginning with "SK"textNO
AL13:AL3000Cell Value="V"textNO
AK13:AK3000Cell Value="V"textNO
AK13:AK3000Cell Valuebeginning with "PR"textNO
AJ13:AJ5000Cell Value="Nytt prod"textNO
AJ13:AJ5000Cell Value="V"textNO
AJ13:AJ5000Cell Valuebeginning with "OV"textNO
AI13:AI3000Cell Value="V"textNO
AH13:AH3000Cell Value="Nytt prod"textNO
E13:E2000Dates OccurringyesterdaytextNO
E13:E2000Dates OccurringtodaytextNO
E13:E2000Dates OccurringtomorrowtextNO
E13:E2000Dates Occurringlast 7 daystextNO
E13:E2000Dates Occurringthis weektextNO
E13:E2000Dates Occurringlast monthtextNO
E13:E2000Dates Occurringlast weektextNO
AH13:AH3000Cell Value="V"textNO
Q13:AF1048576Cell Value>1textNO
Q13:AF1048576Cell Value>0textNO
AI13:AI3000Cell Valuebeginning with "PLM"textNO
AH13:AH3000Cell Valuebeginning with "PL"textNO
B13:B26051Cell Value<0textNO
B13:B26051Cell Valuebeginning with "PL"textNO
B13:B26051Cell Valuebeginning with "PR"textNO
B13:B26051Cell Valuebeginning with "OV"textNO
B13:B26051Cell Valuebeginning with "SK"textNO
B13:B26051Cell Valuebeginning with "LA"textNO
 
Upvote 0
I'm sorry, but the more information you add, the more confused I get about your actual requirements. I'm going to have to step back now, and hopefully someone else will step in with a clearer understanding of what you want to do - in relation to the latest code you produced, the structure of your file, and your most recent clarification. Best wishes (y)
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
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