View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default Can someone help me?

Press Alt + F11 and paste this into the code window. If the code window is
dark, then on the menu bar of the VBE, select InsertModule. To run the
macro, in Excel select ToolsMacroMacros click on the macro name then Run.

Sub delRws()
Dim lr As Long, sh As Worksheet
Set sh = ActiveSheet
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row
For i = lr To 2 Step -1
If WorksheetFunction.CountA(Range(sh.Cells(i, 5), _
sh.Cells(i, 10))) = 0 Then
Rows(i).Delete
End If
Next
sh.Range("A2").End(xlDown).Select
End Sub


"ILoveMyCorgi" wrote in message
...
I have an Excel spreadsheet with 10 columns. If columns 5 through 10 are
empty, I want to delete the entire row and move on to the end of my
spreadsheet. Is there a function or an easy Visual Basic macro I can run
to
accomplish this task? Thanks in advance for your help... I do not know
what
I'd do without this resource!