+ Reply to Thread
Results 1 to 2 of 2

Macro relative references

  1. #1
    Registered User
    Join Date
    10-26-2010
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2003
    Posts
    1

    Macro relative references

    I'm attempting create a macro that will add a new line below the line in which the user is, copies all data and formulas from the line above, except for columns G and H. Ends in Column G, ready for editing. I came up the macro below, which does what I want, if you are in row 3, but how do I generalize it.

    Another way to ask the question, how do I change the reference
    Rows("4:4").Select
    to something that means select the row below the one I'm in. e.g.
    Rows("the-one-I'm-in+1").Select

    Please Login or Register  to view this content.
    Any help appreciated.
    JensPeter
    Last edited by davesexcel; 10-27-2010 at 12:03 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,485

    Re: Macro relative references

    Maybe activecell would work, here is an example using activecell
    select a cell in column a and run the 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)

Tags for this Thread

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