Moderatori: Anthony47, Flash30005
Flash30005 ha scritto:Ciao Shadowboy e benvenuto
Quello che richiedi è semplicissimo selezioni tutte le righe dala riga 16 alla riga 8000 e le elimini del resto non vedo valori non compresi tra 0% e 100%
Se c'è qualche altra cosa che devi spiegare... Fai sapere
Ciao
Sub CopiaRiga()
righe = Cells(Rows.Count, 1).End(xlUp).Row
For I = righe To 1 Step -1
Cells(I, 1).Select
If Selection.Value = 70 Then Rows(I & ":" & I).Copy Destination:=Worksheets("Foglio2").Rows(I & ":" & I)
Next I
End Sub
Sub CopiaRiga()
Righe = Cells(Rows.Count, 1).End(xlUp).Row
For I = 1 To Righe
Cells(I, 1).Select
UR = Worksheets("Foglio2").Cells(Rows.Count, 1).End(xlUp).Row + 1
If Selection.Value = 70 Then Rows(I & ":" & I).Copy Destination:=Worksheets("Foglio2").Rows(UR & ":" & UR)
Next I
End Sub
Cells(I, 1).Select
Cells(I, 10).Select
Cells(I, 12).Select
Destination:=Sheets("FoglioX").Cells(Rows.Count, 1).End(xlUp).offset(1,0)
Sub CopiaRiga()
Righe = Cells(Rows.Count, 1).End(xlUp).Row
For I = 1 To Righe
Cells(I, 11).Select
UR = Worksheets("Foglio2").Cells(Rows.Count, 1).End(xlUp).Row + 1
If Selection.Value = Range("L2").Value Then Rows(I & ":" & I).Copy Destination:=Sheets("Foglio2").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
If Selection.Value = Range("M2").Value Then Rows(I & ":" & I).Copy Destination:=Sheets("Foglio3").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
If Selection.Value = Range("N2").Value Then Rows(I & ":" & I).Copy Destination:=Sheets("Foglio3").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Next I
End Sub
If Selection.Value = Range("L2").Value Then Selection.Range("A1:J1").Copy etc etc
Anthony47 ha scritto:Se vuoi copiare solo le colonne A:J e non tutta la riga (intendevi questo, vero?) allora scriverai, ad esempio:
- Codice: Seleziona tutto
If Selection.Value = Range("L2").Value Then Selection.Range("A1:J1").Copy etc etc
Per quanto riguarda i fogli, o imposti una routine per la gestione dell' evento Error, che richiami con On Error Goto, oppure quando generi il file lo generi con tutti i fogli che ti servono, cioe' tutti quelli che predisponi la macro a gestire.
Ciao.
neverlandce ha scritto:
- Codice: Seleziona tutto
If Selection.Value <= Range("L1").Value Then Selection.Range("a1:j1").Copy Destination:=Worksheets("Foglio2").Rows(UR & ":" & UR)
mi copia solo la prima riga
Then Selection.Range("A" & I & ":J" & I).Copy
Destination:=Sheets("Foglio2").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
UR = Worksheets("Foglio2").Cells(Rows.Count, 1).End(xlUp).Row + 1
Anthony47 ha scritto:Per neverlandce: hai provato?
Per Flash: la tua formulazione e la mia fanno la stessa cosa. Range("A1:J1") e' infatti relativo alla selezione corrente.
Ciao.
Sub CopiaRiga()
Righe = Cells(Rows.Count, 1).End(xlUp).Row
For I = 1 To Righe
Cells(I, 11).Select
UR = Worksheets("Foglio2").Cells(Rows.Count, 1).End(xlUp).Row + 1
If Selection.Value = Range("L2").Value Then Selection.Range("A" & I & ":J" & I).Copy Destination:=Sheets("Foglio2").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Next I
End Sub
Sub CopiaRiga()
Worksheets("Foglio1").Select
Righe = Worksheets("Foglio1").Cells(Rows.Count, 1).End(xlUp).Row
For I = 2 To Righe
Cells(I, 11).Select
MsgBox Selection.Value
If Selection.Value = Worksheets("Foglio1").Range("L1").Value Then Worksheets("Foglio1").Range(Cells(I, 1), Cells(I, 10)).Copy Destination:=Sheets("Foglio2").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Next I
End Sub
If Selection.Value = Range("L2").Value Then Range("A" & I & ":J" & I).Copy Destination:= etc etc
neverlandce ha scritto:...La tua macro non mi copia nulla
neverlandce ha scritto:...
e poi esce quella combpx che si ferma su ogni cella della colonna K meglio non metterla
MsgBox Selection.Value
Sub CopiaRiga()
Worksheets("Foglio1").Select
Righe = Worksheets("Foglio1").Cells(Rows.Count, 1).End(xlUp).Row
For I = 2 To Righe
Cells(I, 11).Select
If Selection.Value = Worksheets("Foglio1").Range("L1").Value Then
Worksheets("Foglio1").Range(Cells(I, 1), Cells(I, 10)).Copy Destination:=Sheets("Foglio2").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Worksheets("Foglio1").Range(Cells(I, 1), Cells(I, 11)).Clear
End If
Next I
Righe = Worksheets("Foglio1").Cells(Rows.Count, 1).End(xlUp).Row
For I = Righe To 2 Step -1
If Range("A" & I).Value = "" Then
Worksheets("Foglio1").Rows(I & ":" & I).Select
Selection.Delete Shift:=xlUp
End If
Next I
End Sub
Sub CopiaRiga2()
Worksheets("Foglio1").Select
Righe = Worksheets("Foglio1").Cells(Rows.Count, 1).End(xlUp).Row
For I = Righe To 2 Step -1
Cells(I, 11).Select
'MsgBox Selection.Value
If Selection.Value = Worksheets("Foglio1").Range("L1").Value Then
Worksheets("Foglio1").Range(Cells(I, 1), Cells(I, 10)).Copy Destination:=Sheets("Foglio2").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Worksheets("Foglio1").Rows(I & ":" & I).Select
Selection.Delete Shift:=xlUp
End If
Next I
End Sub
Torna a Applicazioni Office Windows
colora parte di frase/ Parola in stessa cella Autore: raimea |
Forum: Applicazioni Office Windows Risposte: 6 |
Macro che scatta quando cambia dato in un altro file Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 7 |
Inserire 2 valori nella stessa cella Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 2 |
Excel: formula automatica per evidenziare prodotto scaduto Autore: gamma_ray |
Forum: Applicazioni Office Windows Risposte: 3 |
Visitano il forum: Nessuno e 62 ospiti