+ Reply to Thread
Results 1 to 3 of 3

How to loop through and name each cell iteratively

  1. #1
    Registered User
    Join Date
    08-08-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    46

    Angry How to loop through and name each cell iteratively

    hey all,

    I am trying to find the function or code in order to loop through and name each cell in a range iteratively.

    For Example,

    Cells A1,A2,A3,A4 would need to be renamed

    so in psuedo code

    name cell a1 ag.1
    name cell a2 ag.2
    name cell a3 ag.3
    name cell a4 ag.4

    Most of the naming is done in string literals which I am not sure how to get passed using a loop.
    Any help would be appreciated.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,093

    Re: How to loop through and name each cell iteratively

    Creating a loop isn't a problem. But your choice of name structure is. You won't be able to have a full stop/dot/decimal point. And you won't be able to have "ag" ... unless it is part of something longer because it could be considered to be a cell address in its own right.

    I tend to call Named Ranges nrxxxx...xxx. So, you could maybe have, nrAG + row number.


    Why do you want to do this?


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,093

    Re: How to loop through and name each cell iteratively

    Untested:

    Please Login or Register  to view this content.

    Regards, TMS

+ 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. Add series iteratively to a chart
    By Mario_aero in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-12-2014, 11:19 AM
  2. [SOLVED] Transpose iteratively???
    By hscmsf in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-06-2013, 04:59 PM
  3. Macro for iteratively updating a grid based on inputs
    By swagatkarnany in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-21-2012, 02:18 AM
  4. How to iteratively name columns
    By darsh89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-22-2011, 08:57 PM
  5. Iteratively delete rows from a spreadsheet
    By wruwtrix in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-14-2009, 10:17 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