| | Post: 110 | Registrato il: 19/08/2005
| Utente Junior | | OFFLINE | |
|
12/03/2008 09:06 | |
Sub elimina()
'parte dalla 2° riga ed elimina le 8 righe successive, ne salta 3 e riparte fino alla riga 6200
For i = 2 To 6200 Step 3
For k = 1 To 8
Cells(i, 1).EntireRow.Delete
Next k
Next i
End Sub
------------------------------------------------------------------------------
Sub elim_riga()
'elimina le righe 3,6,9,12.....
For i = 3 To 5000 Step 2
Cells(i, 1).EntireRow.Delete
Next i
End Sub
------------------------------------------------------------------------------
Sub formatta_parziale()
'formatta in grassetto i primi 4 caratteri della celle della colonna A
For i = 1 To 100
Cells(i, 1).Select
With ActiveCell.Characters(Start:=1, Length:=4).Font
.FontStyle = "Grassetto"
End With
Next i
End Sub
------------------------------------------------------------------------------
Sub cancella_alcuni_caratteri()
'cancella i primi 4 caratteri della celle della colonna A
For i = 1 To 100
Cells(i, 1).Select
With ActiveCell.Characters(Start:=1, Length:=4).Delete
End With
Next i
End Sub
------------------------------------------------------------------------------
Sub inverti_cella()
'inverte in contenuto di una selezione di celle, tipo "nome cognome" -> "cognome nome"
For Each Window In Windows
For Each Worksheet In Window.SelectedSheets
For Each cell In Application.Selection
addr = Worksheet.Name & "!" & cell.Address
If Len(Range(addr).Text) > 0 Then
temp = Range(addr).Value
x = InStr(temp, " ")
If x Then
temp = Mid(temp, x + 1) & " " & Left(temp, x - 1)
Range(addr).Value = temp
End If
End If
Next cell
Next Worksheet
Next Window
End Sub |
|
|