
Sub a()
Sheets("Table 1").Select
aname = "Adecco"
drow = 2
With ActiveSheet.UsedRange
Set c = .Find(aname, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Row
Sheets(2).Cells(drow, 1) = .Cells(firstAddress, 1)
Sheets(2).Cells(drow + 1, 1) = .Cells(firstAddress + 1, 1)
drow = drow + 2
Do
Set c = .FindNext(c)
crow = c.Row
Sheets(2).Cells(drow, 1) = .Cells(crow, 1)
Sheets(2).Cells(drow + 1, 1) = .Cells(crow + 1, 1)
drow = drow + 2
Loop While Not c Is Nothing And c.Row <> firstAddress
End If
End With
End Sub
|
Sub elimina()
Sheets(2).Select
parola = InputBox("Parola da eliminare ")
Cells.Replace What:=parola, Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub |
Sub a()
Sheets("Table 1").Select
aname = "Adecco"
drow = 2
With ActiveSheet.UsedRange
Set c = .Find(aname, LookIn:=xlValues)
If Not c Is Nothing Then
'se trovo parole chiave (ad esempio "corso" ) all'interno delle righe selezionate , non mi copiare la stringa
firstAddress = c.Row
Sheets(2).Cells(drow, 1) = .Cells(firstAddress, 1)
Sheets(2).Cells(drow + 1, 1) = .Cells(firstAddress + 1, 1)
drow = drow + 2
Do
Set c = .FindNext(c)
crow = c.Row
Sheets(2).Cells(drow, 1) = .Cells(crow, 1)
Sheets(2).Cells(drow + 1, 1) = .Cells(crow + 1, 1)
drow = drow + 2
Loop While Not c Is Nothing And c.Row <> firstAddress
End If
End With
End Sub
Sub elimina()
Sheets(2).Select
parola = InputBox("Parola da eliminare ")
' non vorrei mettere un inputbox con la parola da cercare , ma una variabile che contenga già alcune parole con separatore, se possibile
Cells.Replace What:=parola, Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub |
Sub elimina()
Sheets(2).Select
parole = Array("Assunta", "Esperienza", " Agenzia")
For i = 0 To UBound(parole)
Cells.Replace What:=parole(i), Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Next
End Sub |
