Quote:
Originally Posted by p45cal
|
Thank you for your reply. The area of named range can suffice me, although I can get the single cell result by adding some new line of codes (see the modified code. I define relative named range in the way the last cell of the area is the single cell result). But a problem remains: when I am in cell E1 (column E) and I enter 1 in the inputbox, excel goes to I1: I2 range rather than e1: e2 range(which is expected according to your reply) Can you guide me on this issue?
Sub gotopresedence()
Dim rng As Range
Dim n As Integer
Application.Goto Reference:=Selection
Application.Goto Reference:=ActiveCell.DirectPrecedents.Areas(Input Box("which precedenceż"))
Set rng = Selection
n = Selection.Rows.Count
rng(n).Select
End Sub