View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default linked cells loop?

Dim rng as Range
Dim rng1 as Range
Dim cell as Range

On Error Resume Next
set rng = Cells.Specialcells(xlformulas)
On Error goto 0
if not rng is nothing then
for each cell in rng
if instr(1,cell.formula,"!",vbTextcompare) then
' run code
' the below can be used to check if it is getting the right cells
if rng1 is nothing then
set rng1 = cell
else
set rng1 = union(rng1,cell)
end if
end if
Next
if not rng1 is nothing then
rng1.Select
End if
End if

--
Regards,
Tom Ogilvy


"Johnny Base" wrote in message
...
Hmmm Here is an example of linked cell in the definition that I am using:

In sheet1 I have "hehe" in A1
In sheet2, I have "='sheet1'!A1" in A3 and A3 shows "hehe"

I am unsure on how to explain it without an example....hope that clears

things up....