Ciao Ricky,
Post by Rickyho provato ad adattare il codice ai miei dati,
ma credo di non aver capito le istruzioni che dai.
Forse oggi sono un pò cotto....
Post by Norman JonesSet rng2 = Rng1.SpecialCells(xlCellTypeFormulas, xlLogical)
Fa riferimento alla formula trascinata nella colonna E?
=SE(E(D17<>"";D17+14>OGGI());"NEW";"")
Mi sà che per me, oggi è meglio prendere un break....
No Ricky, sono io che non ha capito: pensavo di una formula di tipo:
=SE(E(D17<>"";D17+14>OGGI());VERO;"")
Comunque, prova:
'=============>>
Public Sub Tester()
Dim WB As Workbook
Dim SH1 As Worksheet
Dim SH2 As Worksheet
Dim Rng1 As Range
Dim Rng2 As Range
Dim RngDest As Range
Dim rCell As Range
Const RigaCategoria = 8 '<<=== CAMBIARE
Application.ScreenUpdating = True
Set WB = ActiveWorkbook '<<=== CAMBIARE
Set SH1 = WB.Sheets("Foglio1") '<<=== CAMBIARE
Set SH2 = WB.Sheets("Foglio4") '<<=== CAMBIARE
Set Rng1 = SH1.Range("E:E,I:I,M:M,Q:Q,U:U,Y:Y")
On Error Resume Next
Set Rng2 = Rng1.SpecialCells(xlCellTypeFormulas, xlConstants)
On Error GoTo 0
If Rng2 Is Nothing Then Exit Sub
On Error Resume Next
Rng2.Replace What:="""NEW""", _
Replacement:="True", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
If Err.Number <> 0 Then Exit Sub
On Error GoTo 0
Set Rng2 = Rng2.SpecialCells(xlCellTypeFormulas, xlLogical)
Set RngDest = SH2.Cells(Rows.Count, "A").End(xlUp)
For Each rCell In Rng2.Cells
With rCell
Set RngDest = RngDest(2)
RngDest.Value = SH1.Cells(RigaCategoria, rCell.Column).Value
RngDest(1, 2).Value = rCell.Offset(0, -3).Value
RngDest(1, 3).Value = rCell.Offset(0, -1).Value
End With
Next rCell
Rng2.Replace What:="TRUE", _
Replacement:="""NEW""", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
Application.ScreenUpdating = False
End Sub
'<<=============
---
Regards,
Norman