Closed Thread
Results 1 to 3 of 3

Locked as a cross post >> naming a selected range

  1. #1
    Registered User
    Join Date
    03-14-2007
    Posts
    1

    Locked as a cross post >> naming a selected range

    Hello everyone;
    I am a complete newbie so bear with please. I have been trying to name a selected range in VBA. Code so far is as follows:
    ActiveSheet.Name = TextN
    Range("c9").CurrentRegion.Select
    Call formatting
    ActiveWorkbook.Names.Add Name = "formTextN", RefersToR1C1 = Worksheets(TextN) & "!" & "r9c2:r45c13"

    The formatting only works if I place it ahead of the activeworkbook line. But the range is never named.

    Please advise as what I am doing wrong.

    Thanks in advance.

    Paolo

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Cross posted:

    http://www.ozgrid.com/forum/showthre...d=1#post339894
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    PMTREVISAN

    Please read forum rules - links to te rules are below

    Failure to follow the rules may see your message deleted

    NBVC

    thanks for pointing out this is posted to multiple forum sites
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

Closed Thread

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