View Single Post
 
Old 07-13-2023, 04:04 AM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2021
Expert
 
Join Date: Apr 2014
Posts: 948
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

This should do it (no need for the other lines):
Code:
Sub gotopresedence()
Application.Goto Reference:=ActiveCell.DirectPrecedents.Areas(InputBox("what precedence"))
End Sub
It's the Areas part that was missing.


re:
Quote:
Originally Posted by soroush.kalantari View Post
As far as I know, there is no way to write a code that does this job for precedents which are out of the sheet the active cell lies
Have an explore of the likes of:
Code:
With ActiveCell
  .ShowPrecedents
  .NavigateArrow TowardPrecedent:=True, ArrowNumber:=1, LinkNumber:=1
  .Parent.ClearArrows
End With
Reply With Quote