Results 1 to 7 of 7

Thread: [RESOLVED] Updating cells' references

  1. #1

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Resolved [RESOLVED] Updating cells' references

    This is a similar question to that I wrote in this thread but whereas I referred in it to a cell's contents, this now has to do with the cell's location.

    If in a macro you have a line referencing to a cell, for example:

    Cells(19, 5).Value = "100"

    and then you insert a row above that cell, now the macro will place he value "100" in cell(20,5) instead. Is there an alternative way to write the macro so that you don't need to change the cell's col/row references in these cases? It's a pain in the neck and a source of errors when you have a large amount of references to manually update.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Updating cells' references

    s there an alternative way to write the macro so that you don't need to change the cell's col/row references in these cases?
    The best alternative is to used "Named ranges".
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  3. #3

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Updating cells' references

    Quote Originally Posted by DKenny
    The best alternative is to used "Named ranges".
    I have no idea what these are, though the name sounds vaguely familiar. I've search with Google but despite a large number of hits they don't seem to bear a direct relationship with Excel. Could you please give me a hint?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  4. #4
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Updating cells' references

    Have a look at "Define named cell references or ranges" in the Excel Help File.
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  5. #5

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Updating cells' references

    Now, wait a minute. I think I typed "namespaces" without a blank separation. I've just tried "named spaces" and found this which seems more like it. Is that what you meant?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  6. #6

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Updating cells' references

    Quote Originally Posted by DKenny
    Have a look at "Define named cell references or ranges" in the Excel Help File.
    I didn't notice you had already answered. Thanks.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  7. #7

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Updating cells' references

    Quote Originally Posted by DKenny
    Have a look at "Define named cell references or ranges" in the Excel Help File.
    Thanks a lot, I think this made my day no matter how simple it may be.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width