preset range
- From: Novice Lee <NoviceLee@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 21 Oct 2008 07:35:01 -0700
I have the following Module:
Sub DelEmptyRow()
Rng = Selection.Rows.Count
ActiveCell.Offset(0, 0).Select
Application.ScreenUpdating = False
For i = 1 To Rng
If ActiveCell.Value = 0 Then 'You can replace "" with 0 to delete rows
with 'the value zero
Selection.EntireRow.Delete
ElseIf ActiveCell.Value = "Company" Then
Selection.EntireRow.Delete
ElseIf ActiveCell.Value = "Controlling Area :" Then
Selection.EntireRow.Delete
ElseIf ActiveCell.Value = "Proj. number" Then
Selection.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Next i
End Sub
What can I add so I don't have to select the data and use a pre determined
range of "A8:Z300" as the selection set. Also is there a way to make the code
smaller?
.
- Follow-Ups:
- Re: preset range
- From: Rick Rothstein
- RE: preset range
- From: JLGWhiz
- Re: preset range
- Prev by Date: Re: Monthly Calendar Form
- Next by Date: Re: Use VBA to reset data validation (=list) value to first value in that list (list is a named range)
- Previous by thread: Validation of text cells through Code
- Next by thread: RE: preset range
- Index(es):
Relevant Pages
|