deleting rows

M

mohavv

Hi,

After opening a txt file all the page header appear after every 31
rows.
All exactly the same.

I want to create a macro to create a workable sheet, using text to
column. I know how to do this, but ...

first I want to get rid of all the unnecessary rows ("headers" and
"footers"). Using relative cell reference to delete these rows didn't
work, because I have to know how often it has to do this. The files
vary in length, so this is not possible.

Is it possible to have excel find all the values in cell A3 and delete
the rows which are the same or contain the same text.

If I know how to do this, I'll probably can find out how to go on.

Cheers,

Harold
 
C

carlo

You can do this:

for i = 4 to cells(65536,1).end(xlup).row
if cells(i,1).value = cells(3,1).value then
rows(i).delete (xlup)
i = i - 1
end if
next i

hth

Carlo
 

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