Ciao a tutti,
scrivo per chiedere il vostro aiuto in quanto mi trovo in difficoltà.
Su un foglio chiamato "GENERALE", dovrei attivare due pulsanti per Macro che copino righe che soddisfino condizioni di contenuto di una cella e le incollino su due fogli diversi:
uno denominato "DA PREPARARE" e l'altro " Pronte".
Ho utilizzato questi codici ma le macro non sopiano i dati come richiesto:
la prima:
Sub Preparazione ()
Dim i As Integer
Dim cont As Integer
Sheets("GENERALE").Select
Range("A4:M450").Select
Selection.Copy
Sheets("PREPARAZIONE").Select
Range("A4").Select
ActiveSheet.Paste
Application.ScreenUpdating = False
With ActiveSheet
righe = Range("M450").End(xlUp).Row
End With
cont = 0
i = 3
If Cells(i, 12) = "DA PREPARARE" Then
Range(Cells(i, 1), Cells(righe + cont, 12)).Copy Destination:=Cells(i, 12)
cont = cont + 1
i = i + 1
End If
Range(Cells(i + cont, 1), Cells(i, 12)).ClearContents
Application.ScreenUpdating = True
Sheets("PREPARAZIONE").Select
End Sub
la seconda:
Sub PRONTE()
Dim i As Integer
Dim cont As Integer
Sheets("GENERALE").Select
Range("A4:M450").Select
Selection.Copy
Sheets("PRONTE").Select
Range("A4").Select
ActiveSheet.Paste
Application.ScreenUpdating = False
With ActiveSheet
righe = Range("M450").End(xlUp).Row
End With
cont = 0
i = 3
If Cells(i, 13) = "PRONTA" Then
Range(Cells(i, 1), Cells(righe + cont, 13)).Copy Destination:=Cells(i, 13)
cont = cont + 1
i = i + 1
End If
Range(Cells(i + cont, 1), Cells(i, 13)).ClearContents
Application.ScreenUpdating = True
Sheets("PRONTE").Select
End Sub
Mi potete aiutare??