Hi
Ok now I have added this code:
but it does not work properly because it is suppose to loop through. When I hit the process button the first time around it should run this code in cloumn B and the values should stay there, and when I hit the process button again it should do exactly the same code as in column B but only in column C and so on. Each column has a date heading and based on what the date is on "data2" it should run the code only in that specific column
Sheets("ALL").Select
Range("b49").Select
ActiveCell.FormulaR1C1 = _ "=IFERROR(IF(AND(R47C2=data2!R1C8,data2!R1C9=1)*TRUE,VLOOKUP(RC1,data2!R2C1:R4000C15,2,0),""""),""NR"")"
Sheets("ALL").Range("b49").copy Destination:=Range("b50:b105,b108:b126")
Range("B49:B105").Select
Selection.copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B108:B126").Select
Selection.copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C49").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(IF(AND(R47C2=data2!R1C8,data2!R1C9=2)*TRUE,VLOOKUP(RC1,data2!R2C1:R4000C15,2,0),""""),""NR"")"
Sheets("ALL").Range("c49").copy Destination:=Range("c50:c105,c108:c126")
Range("c49:c105").Select
Selection.copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("c108:c126").Select
Selection.copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Ok now I have added this code:
but it does not work properly because it is suppose to loop through. When I hit the process button the first time around it should run this code in cloumn B and the values should stay there, and when I hit the process button again it should do exactly the same code as in column B but only in column C and so on. Each column has a date heading and based on what the date is on "data2" it should run the code only in that specific column
Sheets("ALL").Select
Range("b49").Select
ActiveCell.FormulaR1C1 = _ "=IFERROR(IF(AND(R47C2=data2!R1C8,data2!R1C9=1)*TRUE,VLOOKUP(RC1,data2!R2C1:R4000C15,2,0),""""),""NR"")"
Sheets("ALL").Range("b49").copy Destination:=Range("b50:b105,b108:b126")
Range("B49:B105").Select
Selection.copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B108:B126").Select
Selection.copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C49").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(IF(AND(R47C2=data2!R1C8,data2!R1C9=2)*TRUE,VLOOKUP(RC1,data2!R2C1:R4000C15,2,0),""""),""NR"")"
Sheets("ALL").Range("c49").copy Destination:=Range("c50:c105,c108:c126")
Range("c49:c105").Select
Selection.copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("c108:c126").Select
Selection.copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False