LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Loop through cells to find dependents

I having brain issues...

I've completely forgotten how to trap an error in a loop

Here is what I have (watch out for lines wrapping):
Sub MapDependencies()
Dim cell As Range
For Each cell In ThisWorkbook.Sheets("Summary").Range("A1:L64")

ThisWorkbook.Sheets("Dependencies").Range("b65000" ).End(xlUp).Offset(1,
0).Value = cell.DirectDependents.Address

ThisWorkbook.Sheets("Dependencies").Range("b65000" ).End(xlUp).Offset(0,
-1).Value = cell.Address
Next cell
End Sub

Cell A1 has no dependencies, so error 1004 'No cells were found' pops up. I
can trap the first error in the loop, but if any other subsequent cell errs
then it is no longer trapped.

Any ideas?
 
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
Technically, can anyone explain to me why Cells.Find() is so much faster than a loop? Will[_13_] Excel Programming 3 November 6th 07 07:34 PM
Loop thru cells and find match Consuelo Guenther[_2_] Excel Programming 1 November 2nd 06 11:12 PM
loop to find cells with specified value webby2006[_9_] Excel Programming 3 August 7th 06 04:51 PM
Make a loop to Find a value then move a row of cells Bill F Excel Programming 1 June 8th 06 08:24 AM
Problem with cells.Find within a loop jowatkins Excel Programming 4 December 9th 03 01:39 PM


All times are GMT +1. The time now is 06:16 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"