I have a very large spreadsheet of Excel 2007. I want to delete 5 rows in every 6. over a total of approx 1000 rows. i.e. discard 5/6 of information. I have found the macro to delete alternate rows, but my programming skill is nil! Any ideas please?
I have a very large spreadsheet of Excel 2007. I want to delete 5 rows in every 6. over a total of approx 1000 rows. i.e. discard 5/6 of information. I have found the macro to delete alternate rows, but my programming skill is nil! Any ideas please?
Is there any condition based on which the row should be deleted?
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Rows down are intervals of 10 minutes from a data logger. I only want to analyse results for each hour. So I want to retain rows 6, 12, 18 etc.
Many thanks
Al.
Last edited by Baytreeal; 01-16-2013 at 10:42 AM.
Try this code
Copy the Excel VBA codePlease Login or Register to view this content.
Select the workbook in which you want to store the Excel VBA code
Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
Choose Insert | Module
Where the cursor is flashing, choose Edit | Paste
To run the Excel VBA code:
Choose Tools | Macro | Macros
Select a macro in the list, and click the Run button
I understand the procedure, and posted your code into a module. However, when I run the macro, I get the message Run-time error '9'; Subscript out of range. The debugger highlights the line 'With Worksheets ("Sheet1")'
Many thanks for your continued help.
Best wishes
Al
Is the sheet containing the data called "Sheet1" ? If not, edit the code to reflect the name of your sheet.
Problem solved - that's saved me many hours of work ! Thank you !!
Best wishes
Al
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks