Hello,
I have a macro to rearrange data in a worksheet but I need it to repeat for the entire sheet. Any help is appreciated.
Each record in my report is split into two rows in excel with the header appearing above each line. I need to move the second row of the record up along with the first row so I have a continuous record. This needs to be done for every single record in the entire worksheet. There is also a filler between each set of record which needs to be deleted. I recorded a macro for doing this on a sample report with two sets of records. Now I need to update the macro to basically repeat it for the entire sheet. I have attached a sample file with the report prior to running the prior and after running the macro.
Sub Macro1() ' ' Macro1 Macro ' Range("A11:K12").Select Selection.Cut Range("L9").Select ActiveSheet.Paste Rows("11:13").Select Selection.Delete Shift:=xlUp Range("A13:K14").Select Selection.Cut Range("L11").Select ActiveSheet.Paste Rows("13:15").Select Selection.Delete Shift:=xlUp End Sub
Last edited by Neethu; 01-27-2012 at 07:56 PM. Reason: Added code tags and attached sample file
Welcome to the forum. Unfortunately ...
Your post does not comply with Rule 3 of our Forum 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
To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook. Don't upload a picture when you have a workbook question. None of us is inclined to recreate your data. Upload the workbook and manually add an 'after' situation so that we can see what you expect. In addition clearly explain how you get the results..
To attach a file to your post, you need to be using the main 'New Post' or 'New Thread' page and not 'Quick Reply'.
To use the main 'New Post' page, click the 'Post Reply' button in the relevant thread.
On this page, below the message box, you will find a button labelled 'Manage Attachments'.
Clicking this button will open a new window for uploading attachments.
You can upload an attachment either from your computer or from another URL by using the appropriate box on this page.
Alternatively you can click the Attachment Icon to open this page.
To upload a file from your computer, click the 'Browse' button and locate the file.
To upload a file from another URL, enter the full URL for the file in the second box on this page.
Once you have completed one of the boxes, click 'Upload'.
Once the upload is completed the file name will appear below the input boxes in this window.
You can then close the window to return to the new post screen.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks