Erasing rows

E

Elie

I get outputs from a program into a text files (*.lis) containing
values I am interested in and text I would like to erase (to create
graphs). After converting the .lis file to an excel I get the file
where the data is organized in groups of rows such that each group has
6 consecutive text lines, followed by 12 consecutives data lines, and
so on. I tried the following Macro:

Rows("1:6").Select
Selection.Delete Shift:=xlUp
End Sub

When following the first Macro activation I move the cursor to the row
after the data (row 13), obviously the delete is done starting the
first row, so it deletes the rows with the data that I want. How do I
get this Macro to work for me ? Something like a command to move a
number of rows forward.

Second question: Regarding accessing Macros. What is Personal.xls to
which the Macro is attached. When trying to pick a Macro up I get a
note stating that the file is hidden and I should unhide it. Can I
work with each Macro in all Excel files and worksheets ?
Thanks for any advice.
 
B

Bob Umlas

This procedure will delete the 6 rows from the active cell and below:
Sub Delete6()
Activecell.Resize(6).EntireRow.Delete
End Sub

Personal.xls is simply a workbook which is hidden by default. You don't need
to unhide it to add macros to it (or change or delete them). Depending on
how the macro was written, it usually would work on the active workbook,
active sheet. You can use all the macros available in all open workbooks.

HTH
Bob Umlas
Excel MVP
 
E

Elie

Thanks for this introduction. As a follow up - what will be the way to
have the routine, after the delete, jump 12 rows, and than keep on
going, deleting 6, jumping 12, and so on, say n times.
Elie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top