Results 1 to 3 of 3

Defining a Named Range using Offset

Threaded View

  1. #1
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    Defining a Named Range using Offset

    Hi,

    Does anyone know how I can define a named range using Offset in Vba?
    I recorded the following macro to get an idea of what I needed but I'm unsure how to adapt it for Offset

    Sub Macro8() 
    '
    ' Macro8 Macro
    ' Macro recorded 08/10/2012 by Baz
    '
    
    '
        Range("C423:C427").Select
        ActiveWorkbook.Names.Add Name:="Test", RefersToR1C1:= _
            "='Sheet1'!R423C3:R427C3"
    End Sub
    I tried a few things but have been unable to get any variation to work. I need it to give a selected range a name and the name needs to be the value of a textbox on a userform.

    For example

    Range(rCl.Offset(1, 0), rCl.Offset(2, 0)).Select
            Selection.ActiveWorkbook.Names.Add Name:= Me.txtRange.Value
    Thanks in advance
    Last edited by Baziwan; 10-10-2012 at 10:22 AM.
    Kind Regards

    Baz

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1