Closed Thread
Results 1 to 2 of 2

Appoint a range of cells with a macro

  1. #1
    Registered User
    Join Date
    12-01-2007
    Posts
    42

    Appoint a range of cells with a macro

    Hello everyone,

    Here is my problem:

    In a column I have a series of 300 numbers ranging from C6 to C305.
    I have appointed a range of cells in this column, ranging from C6 to C112, "Abcissa".
    I would like, using a macro, delete "Abcissa" rename to another range of cells in the same column, which would, for example, from C6 to C255, always "Abcissa".
    "Abcissa" is the name of the range "C6: Cx" where x belongs to [6, 305].

    In cell G6 is the address of the variable range of cells, in the form of:
    "C6: C112" (in the first case), then "C6: C255" (in the latter).

    I tried the following:

    Sub Macro1()

    Dim Cellule As Range
    Set Cellule = Range ("G6"). Value
    ActiveWorkbook.Names ("Abcissa"). Delete
    Range (Cellule.Address). Name = "Abcissa"

    End Sub

    But it did not work...

    A big thank you for any help.

    PS: excuse me for my bad english.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Appoint a range of cells with a macro

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    Also moved to programming as per forum rules

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

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