+ Reply to Thread
Results 1 to 4 of 4

How to define name range in vba

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,095

    Post How to define name range in vba

    hi,

    i want to know here about this line

    Please Login or Register  to view this content.
    what is the meaning of above code
    Use Code-Tags for showing your code :
    Please mark your question Solved if there has been offered a solution that works fine for you
    If You like solutions provided by anyone, feel free to add reputation using STAR *

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: How to define name range in vba

    Hi,

    See the annotated macro below for an explanation.
    Please Login or Register  to view this content.
    Lewis

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to define name range in vba

    The .RefersTo is a parameter of the .Name property of a range. However if you look at the named range properties in the Name Wizard, you'll see it always includes an = sign at the beginning:

    =Sheet1!$C$2:$C$19

    The MID function in your code simply stripping off that = sign to show just the range as a text string:

    Sheet1!$C$2:$C$19
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,095

    Re: How to define name range in vba

    Thanx sir for replying, I have a code and I am getting error. But I can't sort out the error.
    Will u plz look?

    first i tell u what is the main work of this code.

    when i add some data (text or number) in Range c10:c500, then it looks in Names("ABD") and Names("NAME_SID9"), if same data found in those two names.range then it does nothing. if not found then it add the same data in boths names.ranges.

    not what is the main problem?

    Please Login or Register  to view this content.
    its working properly.
    now what is the problem, the problem is in name range ("NAME_SID9"), if this range have already data till row 99, it working properly, if it has already data above row 100,

    then its giving me a error
    Run-Time Error '438'
    object doesn't support this property or method.


    now thats the problem

+ 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] How can i define below start range as range given in a cell to do a Loop ?? Please help
    By akash kothari in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-25-2015, 12:25 PM
  2. [SOLVED] Define new range names based on existing range name offset 1 column to right
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-03-2014, 07:53 PM
  3. [SOLVED] Define range and then unmerge/edit range
    By bruizer31 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-02-2013, 06:02 PM
  4. excel macro range define to another sheet / named range
    By koi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2013, 10:25 AM
  5. Define range to select from current cell in a full range (using worksheet_change)
    By draddy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-07-2013, 11:48 AM
  6. [SOLVED] Using cell value to define a range (for a variable defined as a range)
    By Sccye in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-02-2012, 10:25 AM
  7. Define named range where user can define size
    By nahousto in forum Excel General
    Replies: 4
    Last Post: 07-06-2009, 05:09 PM

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