Results 1 to 2 of 2

Thread: Updating cell references in Excel macros [Self-resolved]

Threaded View

  1. #1

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

    Updating cell references in Excel macros [Self-resolved]

    Assume you have a cell in Excel with the formula "=D8*C6". If you now insert a row above of a column at the left of the referred cells D8 and C6, the references are automatically updated.
    But if you have this line within a macro:

    Sheets("MU").Cells(30, 6).Value = "100"

    and you add a row on top of cell (30,6), the macro is of course not updated but now the correct line should read

    Sheets("MU").Cells(31, 6).Value = "100"

    So, now, I find myself in an uncomfortable position: I have lots of such references in various macros and need to insert one or two rows to make room for a checkbox that wouldn't look too nice if placed somewhere else. What could I do to avoid extra work?
    Last edited by krtxmrtz; Jun 13th, 2006 at 04:31 AM.
    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