D
Dwoeltje
I need to create what I thought would be a very simple macro; select some
rows, delete them, and then do a File -> Save As, and save the file out as a
tab delimited ascii text file. Simple, right? That's what I thought.
Except that I need to select those rows based on certain criteria. The
spreadsheet in question has seven columns it is using. The first row in the
spreadsheet contains the column names. The fifth column is called Server
Tested (it is column E). The cells in this column can have only one of four
possible values; www1 or www2 or www3 or www5. What I need to do is to select
all the rows that have a cell, in the 5th column of the row, that has a value
of www2 or www3 or www5 (all rows where that cell has a value of www1 I want
to be left alone), and then delete those rows.
Now, if this were a database and I was using SQL, I might use something
similar to this:
Delete * from tablename (where ([dbname.tablename.fieldname] = "www2") or
([dbname.tablename.fieldname] = "www3" or ([dbname.tablename.fieldname] =
"www5")) That might not be exactly correct syntax, but you get the idea.
But I can't find anything anwhere in the Excel menu structure that will even
let me select rows based specific criteria. I was able to get Excel to select
specific cells based on specific criteria, but it only selected the cell, not
the entire row that the cell was in. And then it did offer me any way to do a
delete after selecting the cells (even if it had, it wouldn't have done me
any good because I needed to delete the whole row, not just that specific
cell).
Can you tell me how to do what I need to do?
rows, delete them, and then do a File -> Save As, and save the file out as a
tab delimited ascii text file. Simple, right? That's what I thought.
Except that I need to select those rows based on certain criteria. The
spreadsheet in question has seven columns it is using. The first row in the
spreadsheet contains the column names. The fifth column is called Server
Tested (it is column E). The cells in this column can have only one of four
possible values; www1 or www2 or www3 or www5. What I need to do is to select
all the rows that have a cell, in the 5th column of the row, that has a value
of www2 or www3 or www5 (all rows where that cell has a value of www1 I want
to be left alone), and then delete those rows.
Now, if this were a database and I was using SQL, I might use something
similar to this:
Delete * from tablename (where ([dbname.tablename.fieldname] = "www2") or
([dbname.tablename.fieldname] = "www3" or ([dbname.tablename.fieldname] =
"www5")) That might not be exactly correct syntax, but you get the idea.
But I can't find anything anwhere in the Excel menu structure that will even
let me select rows based specific criteria. I was able to get Excel to select
specific cells based on specific criteria, but it only selected the cell, not
the entire row that the cell was in. And then it did offer me any way to do a
delete after selecting the cells (even if it had, it wouldn't have done me
any good because I needed to delete the whole row, not just that specific
cell).
Can you tell me how to do what I need to do?