+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : To copy the value of a range of cells, adjacent to activecell in a Row

  1. #1
    Registered User
    Join Date
    07-08-2012
    Location
    Abu Dahbi, UAE
    MS-Off Ver
    Excel 2007
    Posts
    3

    To copy the value of a range of cells, adjacent to activecell in a Row

    I need to copy the value of two cells adjacent to active cell range in a single row

    Equipment BOM Component quantity Component Qty

    310020666 03101210024 1 03101210024 1 03101210024 1 03101210024 1 02101110013 1
    310020667 03101210024 1
    310020668 03101210024 1
    310020669 02101110013 1
    310020670 02101110013 1
    310020671 02101110013 1
    310020677 02101110014 1 02101110014 1 02101110014 1 02101110014 1 07004110014 1
    310020678 02101110014 1
    310020679 02101110014 1
    310020689 07004110014 1
    310020690 07004110014 1
    310020691 02101110014 1
    310020692 02101110014 1
    310021701 90000006659 2



    I am using the following macro;


    Please Login or Register  to view this content.

    I need a routine that will auto mate the routine, so that I can select and paste cells adjacent to active cells, for all cells below the first active cell that are of the same value as active cell.
    Last edited by Cutter; 07-08-2012 at 08:51 AM. Reason: Added code tags

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: To copy the value of a range of cells, adjacent to activecell in a Row

    Welcome to the forum Azhar64.

    Notice that I've added code tags to your post. The forum rules require them so please keep that in mind for your future posts. The following is the actual rule:

    RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: To copy the value of a range of cells, adjacent to activecell in a Row

    Please remember to use the # icon to provide code tags, and put your VBA code snips inside those code tags, as per forum rules. I've edited your post this time. Thanks for taking care on future posts.

    I see your logic, you want to be able to select B3:C5 and have it copy itself up row-by-row into the row2 above it.

    But do we need to have you manually select ranges of cells? If you can describe the logic you're using to decide what cells in B:C to select each time, the macro should be able to follow that logic for you automatically and do the whole data set for you all at once. So how are you deciding that?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    07-08-2012
    Location
    Abu Dahbi, UAE
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: To copy the value of a range of cells, adjacent to activecell in a Row

    Thanks for the info, I will try to follow the rules from now onwards.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: To copy the value of a range of cells, adjacent to activecell in a Row

    Azhar, see the unanswered questions from post #3.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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