+ Reply to Thread
Results 1 to 14 of 14

how to drag a row data to next cells

  1. #1
    Registered User
    Join Date
    06-09-2019
    Location
    india
    MS-Off Ver
    2013
    Posts
    29

    how to drag a row data to next cells

    Please someone could help me out here. have attached a sample file.

    What I want to achieve is-

    1) I have a unique ID in cell A1 and then unique id again in cell A13, then again in cell A25, that means after every 12 rows i have a unique id

    2) I need a macro code that will drag the first unique id in A1 to all the cells down till A12, then drag A13 id down till A24

    3) What is challenging here is, that the number of unique ids arent fixed everytime, sometimes there might be 50 such unique ids, at times 65, and so on, So I need the code such that it identifies in the same column where is the last unique number and stop dragging it further down,

    The number of rows to be dragged remains constant, so each unique id will have total of 12 rows.

    Any help would be appreciated, thanks
    Attached Files Attached Files
    Last edited by tushjain00; 08-12-2019 at 03:25 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: how to drag a row data to next cells

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,200

    Re: how to drag a row data to next cells

    Perhaps this...
    Please Login or Register  to view this content.
    Last edited by sintek; 08-12-2019 at 06:44 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Registered User
    Join Date
    06-09-2019
    Location
    india
    MS-Off Ver
    2013
    Posts
    29

    Re: how to drag a row data to next cells

    Excellent. Thanks so much
    Last edited by AliGW; 08-12-2019 at 05:08 AM. Reason: Please don't quote unnecessarily!

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,200

    Re: how to drag a row data to next cells

    Glad I could assist...Thanks for rep +...
    Just a heads up...In future, no need to quote entire posts..just clutters the thread...

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,687

    Re: how to drag a row data to next cells

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Registered User
    Join Date
    06-09-2019
    Location
    india
    MS-Off Ver
    2013
    Posts
    29

    Re: how to drag a row data to next cells

    1 another query related to this code. It worked well when my data starts from first row, what if it starts from some random row say 5th row, what part in the code I need to change? I understood for the column i need to change with columns (1) to with columns (2) in case of 2nd column
    What about the row?

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,200

    Re: how to drag a row data to next cells

    Please Login or Register  to view this content.
    Last edited by sintek; 08-12-2019 at 06:45 AM.

  9. #9
    Registered User
    Join Date
    06-09-2019
    Location
    india
    MS-Off Ver
    2013
    Posts
    29

    Re: how to drag a row data to next cells

    I tried this but it doesnt work well. Please see the solution in this sample file, as to understand what result it gave.
    Attached Files Attached Files

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,200

    Re: how to drag a row data to next cells

    Something like this...
    Please Login or Register  to view this content.
    Last edited by sintek; 08-12-2019 at 07:22 AM.

  11. #11
    Registered User
    Join Date
    06-09-2019
    Location
    india
    MS-Off Ver
    2013
    Posts
    29

    Re: how to drag a row data to next cells

    This didnt work either

  12. #12
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,200

    Re: how to drag a row data to next cells

    I don't get it... This is the result after code is run for Post 9 sample file upload...
    If this is not the result you want then you should upload a sample file with a BEFORE | AFTER scenario...

    Result.png

  13. #13
    Registered User
    Join Date
    06-09-2019
    Location
    india
    MS-Off Ver
    2013
    Posts
    29

    Re: how to drag a row data to next cells

    I am sorry. I did a mistake. But it worked now. Sorry for the trouble. Thanks a lot though

  14. #14
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,200

    Re: how to drag a row data to next cells

    Glad you got it sorted....

+ 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. How to disable drag auto-fill, but allow drag shift-entire-row?
    By superlative in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-02-2019, 06:13 PM
  2. [SOLVED] Help needed making portions of a drag down/multi sheet data pull formula skip cells
    By vmackie in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-21-2014, 05:14 PM
  3. Replies: 2
    Last Post: 03-11-2013, 09:28 AM
  4. Replies: 0
    Last Post: 02-04-2013, 03:25 PM
  5. Replies: 5
    Last Post: 11-28-2012, 10:51 AM
  6. how to drag some data in excel cloumn cells
    By meetvivek72 in forum Excel General
    Replies: 1
    Last Post: 08-23-2012, 07:44 AM
  7. Replies: 9
    Last Post: 11-06-2010, 06:10 AM

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