Pages

Sunday, January 25, 2009

How to select a Named Range in a Workbook using VBA

The following snippet will select the specified named range

Function Goto_A_Name(ByVal sName As String) As Boolean

'

On Error GoTo Err_Going

Application.GoTo Reference:=sName

Goto_A_Name = True

Exit Function

Err_Going:

End Function

2 comments:

  1. Anonymous6:04 PM

    How about

    Range("RngName").select

    ReplyDelete
  2. I like this better, since it doesn't snap the view of the user to to named range. Thanks!

    ReplyDelete