VBA Site contains VBA code to create macros in WORD EXCEL ACCESS OUTLOOK

 

1) Removing empty rows from worksheet

 

Sub RemoveEmptyRows()

Dim row As Range

Dim sheet As Worksheet

Set sheet = ActiveSheet

one:

For i = 1 To sheet.UsedRange.Rows.Count

Set row = sheet.Rows(i)

If WorksheetFunction.CountA(row) = 0 Then

row.Delete

GoTo one

End If

Next i

End Sub

 

2) Removing rows from worksheet if one field is empty in the column

Sub RemoveEmptyRows()

ActiveSheet.UsedRange.Select

Row = Selection.Rows.Count

For i = Row To 2 Step -1

If Cells(i, 19) = Empty Then

Rows(i).EntireRow.Delete

Else

End If

Next i

End Sub



Dodaj komentarz






Dodaj

© 2013-2024 PRV.pl
Strona została stworzona kreatorem stron w serwisie PRV.pl