
Sub n()
Dim c As Worksheet
Set c = Sheets("Tracciato")
x = 100
Do While x > 1
If c.Range("a" & x) = "" Then
c.Range("a" & x).Select
Selection.EntireRow.Delete
End If
x = x - 1
Loop
End Sub
|
Sub n()
Dim c As Worksheet
Dim x As String
Application.ScreenUpdating = False
Sheets("Tracciato").Activate
Set c = Sheets("Tracciato")
x = 50
Do While x > 1
If c.Range("a" & x) = "" Then
c.Range("a" & x).Select
Selection.EntireRow.Delete
End If
x = x - 1
Loop
Application.ScreenUpdating = True
End Sub |
With Sheets("Tracciato")
x = 50
Do While x > 1
If .Range("a" & x) = "" Then
.Range("a" & x).EntireRow.Delete
End If
x = x - 1
Loop
End With |
'elimina le righe in corrispondenza di celle vuote della colonna A
Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
'elimina le celle vuote della colonna A, spostando e compattando verso l'alto quelle non vuote.
Columns("A:A").SpecialCells(xlCellTypeBlanks).Delete shift:= xlShiftUp |
'apro un file txt, importandolo in un foglio di lavoro di una nuova cartella di lavoro che prende il nome del file di testo
FILETOOPEN = Application.GetOpenFilename("TEXT Files (*.TXT), *.TXT", , "Selezionare il file txt da caricare ", "Apri", "False")
file_selezionato = ActiveWorkbook.Name
If FILETOOPEN = False Then
Application.CutCopyMode = False
End
End If
Workbooks.OpenText FILETOOPEN, Origin:=xlWindows, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 2),
....
Set RNG = [a1].Parent.UsedRange
cella = RNG.Find(What:="*", _
After:=RNG.Cells(1), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
Set database = ActiveSheet
Set file = ActiveWorkbook
Sheets.Add.... ' aggiungo alcuni fogli di lavoro ed eseguendo alcuni cicli copio i dati del foglio che ho appena chiamato 'database' nei fogli appena creati.
With file.Sheets("Tracciato 100")
Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End With
With file.Sheets("Tracciato 101")
Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End With
With file.Sheets("Tracciato 102")
Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
....
With file.Sheets("Tracciato 109")
Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End With
End With
|
With Sheets("Tracciato 100")
.Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End With
|
for each sh in file.Worksheets
sh.Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Next |
for each sh in file.Worksheets
If sh.name <> "NomeFoglioEscluso" then
sh.Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
endif
Next |
