Ciao a tutti,
premetto che non ho padronanza con vba;
ho questa macro che mi controlla tutti i valori nella colonna M e riporta i dati nei fogli corrispondenti se il valore coincide.
Public Sub f(ByVal s As String)
Dim Rng As Range
Dim c As Range
Dim r As Range
Dim nr As Long
Dim lr As Long
If s = "Foglio" Then Exit Sub
Application.ScreenUpdating = False
lr = Worksheets(s).Range("A65536").End(xlUp).Row
Worksheets("00").Range("A30:H1000").ClearContents
With Worksheets("Foglio")
nr = .Range("M65536").End(xlUp).Row
Set Rng = .Range("M4:M" & nr)
End With
With Worksheets(s)
For Each c In Rng
If c.Value = .Name Then
.Range("F65536").End(xlUp).Offset(1, 0).Value = c.Value
.Range("F65536").End(xlUp).Offset(0, -5).Value = c.Offset(0, -11).Value
.Range("F65536").End(xlUp).Offset(0, -4).Value = c.Offset(0, -10).Value
.Range("F65536").End(xlUp).Offset(0, -3).Value = c.Offset(0, -9).Value
.Range("F65536").End(xlUp).Offset(0, -2).Value = c.Offset(0, -8).Value
.Range("F65536").End(xlUp).Offset(0, -1).Value = c.Offset(0, -7).Value
.Range("F65536").End(xlUp).Offset(0, 1).Value = c.Offset(0, -5).Value
.Range("F65536").End(xlUp).Offset(0, 2).Value = c.Offset(0, -4).Value
End If
Next
Set Rng = Nothing
End With
Application.ScreenUpdating = True
End Sub
A questa vorrei aggiungere un altra condizione, ovvero ricopiare i dati solo se nella colonna H della riga c'è il valore "prova".
Spero di essere stato chiaro.
Grazie a tutti