Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have been trying to run the following code, and am getting a Next without
For Error Any Ideas? Jim Berglund Sub DelRows() Dim i, n As Long Dim wsNumFrum As Worksheet Set wsNumFrum = Worksheets("Numbers from Reverse Directory") n = wsNumFrum.Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious).Row For i = 1 To n If Range(Cells(i, 1)).Value = "" Then Range(Cells(i, 1), Cells(i, 5)).ClearContents Else Range(Cells(i, 1)).Select If Left(Cells(i, 1), 5).Value = "Lname" Then Range(Cells(i, 1), Cells(i, 5)).ClearContents Else If IsNumeric(Cells(i, 5).Value) Then Range(Cells(i, 1), Cells(i, 5)).ClearContents End If Next 'Sort the data ActiveWorkbook.Worksheets("Numbers from Reverse Directory").Sort.SortFields.Clear ActiveWorkbook.Worksheets("Numbers from Reverse Directory").Sort.SortFields. _ Add Key:=Range("A1"), SortOn:=xlSortOnValues, Order:=xlAscending, _ DataOption:=xlSortNormal With ActiveWorkbook.Worksheets("Numbers from Reverse Directory").Sort .SetRange Range("A1:E5001") .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error when cell A1 is not active and xlInsideVertical border formatthrowing error 1004 | Excel Programming | |||
Error handling error # 1004 Run-time error | Excel Programming | |||
Counting instances of found text (Excel error? Or user error?) | Excel Worksheet Functions | |||
Error Handling - On Error GoTo doesn't trap error successfully | Excel Programming | |||
Automation Error, Unknown Error. Error value - 440 | Excel Programming |