LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Cleaner Error trap in Loop.

In the following code, Im tying to go down the Combined worksheets
columns cells locating the values of the cell in the worksheet VoidReq &
delete that sheets row if found, continuing down the Combined worksheets
columns cell until it runs into empty cell.

The problem is sometimes it will not find the value on the Combined sheet
& I want it to skip over deleting a row & continue on down the column until
it gets to the empty cell at the bottom. I have an error catch Error GoTo
FindAgain but in running the code it seems to only skip over one not found
entry & when it runs into another not found entry it craps out.

I know the code is I have is probably sloppy & I apologize but Im still a
struggling learner

Do While Not IsEmpty(ActiveCell)
If IsEmpty(ActiveCell) Then
Exit Do
Else
Vfind = ActiveCell.Value
Sheets("Combined").Select
On Error GoTo FindAgain
Cells.Find(What:=Vfind, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Delete Shift:=xlUp
FindAgain: Sheets("VoidReq").Select
ActiveCell.Offset(1, 0).Range("A1").Select
End If
Loop



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
On Error Resume Next (when next statement is Do Loop ...) EagleOne Excel Discussion (Misc queries) 2 September 26th 06 03:26 PM
how to put a loop in a macro? Khoshravan New Users to Excel 4 May 14th 06 01:22 PM
Loop time seems dependent on unrelated workbook - Why? Richard Excel Worksheet Functions 2 March 30th 06 11:59 PM
Loop gone crazy Dave Peterson Excel Discussion (Misc queries) 4 December 16th 05 03:38 PM
Do Loop Noemi Excel Discussion (Misc queries) 0 December 8th 05 10:43 PM


All times are GMT +1. The time now is 01:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"