+ Reply to Thread
Results 1 to 6 of 6

I have to move data from one row to antoher row, but in different position (cell)

Hybrid View

  1. #1
    Registered User
    Join Date
    08-14-2020
    Location
    Frankfurt,Germany
    MS-Off Ver
    Office365
    Posts
    2

    I have to move data from one row to antoher row, but in different position (cell)

    HI to Forum!

    Thank you Admin for tips and message, hope now is better :-)

    So, I have Excel files and some data are in wrong place - 2 cells left and one row down.
    Excel is from Office365.


    I have to do a following task:

    Complete row 129,131,133,135 etc... (start with cell B129,C129,D129 etc.) have to be moved on row 128,130,132,134 etc. start with cell D128,D130,D132,D134...

    That mean B129 to D128, C129 to E128 etc...

    In this case, all contents from other cells (B129,C129,D129...) fit correctly in rest of table - B129 is actually D128, C129 is E129 etc.

    So I have actually move content of complete row 129,131,133 etc... 2 cells on the right and one row up.

    I can do this manually, copy one by one, but this is not an option, file is about 35MB and I have to do this every week.

    In attachment you can find a part of file, first two rows are correct and the others have to have same look as the first two rows.
    Also there's another pattern start at row 76 (emtpy row and then pattern as I described)

    Any help/advice are welcome:-)

    Best regards to all:-)
    Attached Files Attached Files
    Last edited by Hooper100; 08-14-2020 at 02:41 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,704

    Re: Help/advice needed

    Welcome to the forum. It is obvious from your post that you did not bother to read the Forum rules that you agreed to.

    1. Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

    Additionally, not part of the rules but if you expect faster responses, then

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: I have to move data from one row to antoher row, but in different position (cell)

    Try this code.....

    Copy and paste into the VBA editor and run. Let me know if you need help with this.
    Private Sub merge_rows()
    
    Dim i As Long
    Dim NumRows As Long
    
        Application.ScreenUpdating = False
        NumRows = ActiveSheet.Range("A65536").End(xlUp).Row
    
        For i = 1 To NumRows
            If i >= ActiveSheet.Range("A65536").End(xlUp).Row Then Exit For
            Application.StatusBar = "Row Number" & i
            
            If Application.WorksheetFunction.CountA(Range("A" & CStr(i) & ":" & "Z" & CStr(i))) = 0 Then
                ActiveSheet.Rows(i).Delete
                i = i - 1
            End If
            If Range("A" & CStr(i)).Value = "" And Range("B" & CStr(i)).Value <> "" Then
                Range("B" & CStr(i) & ":Z" & CStr(i)).Copy
                Range("D" & CStr(i - 1)).PasteSpecial
                ActiveSheet.Rows(i).Delete
                i = i - 1
            End If
        Next i
        
        Application.ScreenUpdating = True
        
    End Sub

  4. #4
    Registered User
    Join Date
    08-14-2020
    Location
    Frankfurt,Germany
    MS-Off Ver
    Office365
    Posts
    2

    Re: I have to move data from one row to antoher row, but in different position (cell)

    Hi Crowtear!

    Thank You very much for Your effort and time, VBA Code works like a charm:-)
    I try twice, just in case, and no problem at all :-)

    Thank You again!

    With best regards!

  5. #5
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: I have to move data from one row to antoher row, but in different position (cell)

    Quote Originally Posted by Hooper100 View Post
    Hi Crowtear!

    Thank You very much for Your effort and time, VBA Code works like a charm:-)
    I try twice, just in case, and no problem at all :-)

    Thank You again!

    With best regards!
    You are very welcome.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,704

    Re: I have to move data from one row to antoher row, but in different position (cell)

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

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. IF function advice needed
    By mairead100 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-12-2014, 06:59 AM
  2. VB/ Formula advice needed
    By DanUK86 in forum Excel General
    Replies: 4
    Last Post: 09-10-2009, 07:57 AM
  3. help advice needed
    By stevencarroll19 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-30-2006, 12:00 PM
  4. Formula Advice Needed
    By Brad_A in forum Excel General
    Replies: 1
    Last Post: 03-03-2005, 03:06 PM
  5. advice needed
    By Duncan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-27-2005, 07:06 PM
  6. Advice needed...
    By Duncan in forum Excel General
    Replies: 3
    Last Post: 01-27-2005, 05:06 PM
  7. advice needed
    By Duncan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2005, 04:06 PM

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