+ Reply to Thread
Results 1 to 2 of 2

VBA for named range where the name of the range is dependent on cell input

Hybrid View

  1. #1
    Registered User
    Join Date
    12-10-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    25

    VBA for named range where the name of the range is dependent on cell input

    Hi, need some help on named range VBA.

    I want to have a name range where the name of the range is dynamic basis input in cell, let us say sheet 1 cell "B10".

    The value of the named range is in Sheet 1 cell "F10".

    Could someone kindly help? thanks in advance.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: VBA for named range where the name of the range is dependent on cell input

    Sub Button1_Click()
        Dim rng As Range
        Set rng = Sheets("Sheet1").Range("F10")
        On Error GoTo er
        Sheets("Sheet1").Range("B10").Name = rng.Value
        Exit Sub
    er:     Sheets("Sheet1").Range("B10").Name = "NoName"
    
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Assign named range to one cell depending on named range in another
    By x65140 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2015, 11:04 AM
  2. dependent listbox with named range
    By rayexcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2014, 12:08 PM
  3. [SOLVED] determining if cell is part of named range and what that named range is
    By stnkynts in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-16-2014, 07:56 PM
  4. Dependent, Dynamic Named Range with Multiple Criteria
    By JustinCredibLee in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-11-2014, 12:46 PM
  5. [SOLVED] Can't use Numbers in named range list for Dependent data validation lists
    By Sam Kuiper in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 11-11-2012, 08:26 PM
  6. Replies: 4
    Last Post: 09-17-2010, 03:44 AM
  7. Replies: 0
    Last Post: 03-07-2007, 12:55 PM

Tags for this Thread

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