+ Reply to Thread
Results 1 to 7 of 7

Macro for defining a range

  1. #1
    Registered User
    Join Date
    08-21-2008
    Location
    Houston
    Posts
    3

    Macro for defining a range

    Hello this is my first post and i am in need of help. I need to have a macro that will automaticaly create ranges. (define a range) .

    I would like a macro that would look in column D and look for the section that has "2" and name that section "oldt", if "7" name new "newnt", if "8" name "newt". The last column will always be "O"

    I have attached what the file i am working looks like.

    Please help if you can.

    Thanks
    Attached Files Attached Files
    Last edited by studentUH; 08-21-2008 at 04:13 PM.

  2. #2
    Registered User
    Join Date
    08-21-2008
    Location
    Houston
    Posts
    3
    can anyone solve this?

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    have some patience. Is this what you mean?

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You have already been asked to read the rules, if you read them all you will see you are asked not to use unnecessary words in the title like Easy. In any case if the code is easy why ask?

  5. #5
    Registered User
    Join Date
    08-21-2008
    Location
    Houston
    Posts
    3
    THANKS!! this is very close to what i need, instead of just naming the cells in column D i need it to also capture all cells to the left and right.

    so for example in the file that i uploaded "newnt" would be from A10 O15

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello studentUH,

    This is macro will create the named ranges covering columns "A to "O". Call the macro "Run" to create your ranges.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try this amended code

    Please Login or Register  to view this content.

+ 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. macro to name a certain range
    By Juhanen II in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2008, 04:26 PM
  2. Macro to PivotTable a SemiPopulated Dynamic Range
    By janssenchoy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2008, 04:19 PM
  3. Print order for range in macro
    By JanineLeMaster in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-16-2007, 05:51 PM
  4. Create Macro To Copy Moving Range of Rows
    By bselwin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-01-2007, 09:04 AM
  5. Print Range Macro "ALMOST" working.
    By Tom44556 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-19-2007, 11:53 AM

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